-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin plugintype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Description
It looks like using capfd.readouterr() in a test also resets what pytest displays in case of failed tests.
For this I think it would be useful to keep the output in total.
capfd = <_pytest.capture.CaptureFixture object at 0x7fc6da051908>
def test_capfd(capfd):
print('stdout')
print(2, capfd.readouterr())
print(3)
> assert 0
E assert 0
tests/test_capfd.py:11: AssertionError
----------------------------------- Captured stdout call ------------------------------------
2 CaptureResult(out='stdout\n', err='')
3
Here the stdout is missing.
pytest master (08aed1a).
Metadata
Metadata
Assignees
Labels
plugin: capturerelated to the capture builtin pluginrelated to the capture builtin plugintype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch