You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Captured stdout for a subtest is not displayed when the --capture option value is fd or sys. It is displayed as expected when the value is tee-sys.
This causes pytest-html plugin not to be able to display them in a report either. (pytest-dev/pytest-html#750)
Minimum code to reproduce:
def test_something(subtests):
print("main test")
with subtests.test("subtest"):
print("sub test")
Logs:
--capture=fd (or sys)
$ pytest -rA
============================================================ test session starts =============================================================
platform darwin -- Python 3.9.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /Users/yugo/Desktop/test
plugins: subtests-0.11.0
collected 1 item
test_something.py ,. [100%]
=================================================================== PASSES ===================================================================
_______________________________________________________________ test_something _______________________________________________________________
------------------------------------------------------------ Captured stdout call ------------------------------------------------------------
main test
========================================================== short test summary info ===========================================================
PASSED test_something.py::test_something
==================================================== 1 passed, 1 subtests passed in 0.02s ====================================================
--capture=tee-sys
$ pytest -rA --capture=tee-sys
============================================================ test session starts =============================================================
platform darwin -- Python 3.9.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /Users/yugo/Desktop/test
plugins: subtests-0.11.0
collected 1 item
test_something.py main test
sub test
,. [100%]
=================================================================== PASSES ===================================================================
_______________________________________________________________ test_something _______________________________________________________________
------------------------------------------------------------ Captured stdout call ------------------------------------------------------------
main test
sub test
========================================================== short test summary info ===========================================================
PASSED test_something.py::test_something
==================================================== 1 passed, 1 subtests passed in 0.02s ====================================================
My suspicion here is this has something to do with the -rA flag. This plugin captures output here so I suspect we'd need to add something which looks at the -rA flag similar to here in terminal.py.
Although I'm not clear how that impacts the html report
Captured stdout for a subtest is not displayed when the
--capture
option value isfd
orsys
. It is displayed as expected when the value istee-sys
.This causes
pytest-html
plugin not to be able to display them in a report either. (pytest-dev/pytest-html#750)Minimum code to reproduce:
Logs:
The text was updated successfully, but these errors were encountered: