Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects.
(request: SubRequest)
| 893 | |
| 894 | @fixture |
| 895 | def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, None]: |
| 896 | """Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. |
| 897 | |
| 898 | The captured output is made available via ``capsysbinary.readouterr()`` |
| 899 | method calls, which return a ``(out, err)`` namedtuple. |
| 900 | ``out`` and ``err`` will be ``bytes`` objects. |
| 901 | """ |
| 902 | capman = request.config.pluginmanager.getplugin("capturemanager") |
| 903 | capture_fixture = CaptureFixture[bytes](SysCaptureBinary, request, _ispytest=True) |
| 904 | capman.set_fixture(capture_fixture) |
| 905 | capture_fixture._start() |
| 906 | yield capture_fixture |
| 907 | capture_fixture.close() |
| 908 | capman.unset_fixture() |
| 909 | |
| 910 | |
| 911 | @fixture |
nothing calls this directly
no test coverage detected