Skip to content

Subtest message not displayed when installed using pip #90

@alex-linx

Description

@alex-linx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions