pytest-subtests icon indicating copy to clipboard operation
pytest-subtests copied to clipboard

Subtest message not displayed when installed using pip

Open alex-linx opened this issue 1 year ago • 1 comments

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%]

alex-linx avatar May 06 '23 16:05 alex-linx

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.

rhoban13 avatar May 07 '23 22:05 rhoban13