pytest-subtests
pytest-subtests copied to clipboard
Subtest message not displayed when installed using pip
I am running the subtests example from the documentation:
def test_foo(subtests):
for i in range(5):
with subtests.test(msg="custom", i=i):
assert i % 2 == 0
I am running the tests using
pytest tests/test_tmp.py -v
When I install using pip
pip install pytest-subtests
I get the following output
tests/test_tmp.py::test_foo SUBPASS [100%]
tests/test_tmp.py::test_foo SUBFAIL [100%]
tests/test_tmp.py::test_foo SUBPASS [100%]
tests/test_tmp.py::test_foo SUBFAIL [100%]
tests/test_tmp.py::test_foo SUBPASS [100%]
tests/test_tmp.py::test_foo PASSED [100%]
However, if I install it directly from github using
pip install git+https://github.com/pytest-dev/pytest-subtests
I get the expected output
tests/test_tmp.py::test_foo [custom] (i=0) SUBPASS [100%]
tests/test_tmp.py::test_foo [custom] (i=1) SUBFAIL [100%]
tests/test_tmp.py::test_foo [custom] (i=2) SUBPASS [100%]
tests/test_tmp.py::test_foo [custom] (i=3) SUBFAIL [100%]
tests/test_tmp.py::test_foo [custom] (i=4) SUBPASS [100%]
tests/test_tmp.py::test_foo PASSED [100%]
I suspect this is simply because https://github.com/pytest-dev/pytest-subtests/pull/88 fixing this landed a few days ago and hasn't yet been published to pypi.