captured_output
Return a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream stream_name with a StringIO.
def captured_output(
stream_name: string
) - > contextmanager
Return a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream stream_name with a StringIO.
Parameters
| Name | Type | Description |
|---|---|---|
| stream_name | string | The name of the attribute in the sys module to be temporarily replaced, such as 'stdout', 'stderr', or 'stdin' |
Returns
| Type | Description |
|---|---|
contextmanager | A context manager that yields the StringIO object replacing the original system stream |