Expand description
Test utilities for output component testing.
This module provides infrastructure for capturing and asserting on output from RichOutput components in tests.
Modules§
- fixtures
- Test fixtures for common scenarios. Test fixtures for common output scenarios.
Structs§
- Output
Entry - A single captured output entry with metadata.
- Test
Output - Test output buffer that captures all output for assertions.
Enums§
- Output
Level - Output classification for test assertions.
Functions§
- assert_
contains - Assert output contains text (after stripping ANSI codes).
- assert_
contains_ in_ order - Assert output contains all expected substrings in order.
- assert_
has_ ansi - Assert output has ANSI codes (for rich mode testing).
- assert_
max_ width - Assert all lines are within max width.
- assert_
no_ ansi - Assert output has no ANSI codes (for plain mode testing).
- assert_
not_ contains - Assert output does NOT contain text.
- capture
- Capture output from a closure in the specified mode.
- capture_
both - Capture both plain and rich output for comparison.
- capture_
with_ width - Capture with custom terminal width.
- debug_
output - Log captured output for debugging.
- is_
verbose - Enable verbose test logging (set FASTAPI_TEST_VERBOSE=1).
- strip_
ansi_ codes - Strip ANSI escape codes from a string.