-
Notifications
You must be signed in to change notification settings - Fork 248
Closed
Description
Captured stdout in a subtest is not displayed as expected. Tested with v3.2.0 and v4.0.2 - both have the issue in a different way. Also the issue behavior changes depending on the --capture
option value. I tried fd
(the default value) and tee-sys
. Only v3.2.0 with --capture tee-sys
seems to work as expected.
- Test code to reproduce:
def test_something(subtests):
print("main test")
with subtests.test("subtest"):
print("sub test")
-
Results:
-
v3.2.0
- command: pytest --html fd_3.2.0.html
-> Captured stdout from the subtest is missing - command: pytest --html tee-sys_3.2.0.html --capture tee-sys
-> Looks good
- command: pytest --html fd_3.2.0.html
-
v4.0.2
- command: pytest --html fd_4.0.2.html
-> main test and subtest are displayed as separate tests. One has captured stdout from the main test, the other has captured stdout from the subtest - command: pytest --html tee-sys_4.0.2.html --capture tee-sys
-> main test and subtest are displayed as separate tests. One has no captured stdout, the other has captured stdout from both main test and subtest
- command: pytest --html fd_4.0.2.html
-
Metadata
Metadata
Assignees
Labels
No labels