fresh-cat-90827
10/04/2021, 1:51 PMpytest
skipping the tests when they are selected with markers?fresh-cat-90827
10/04/2021, 1:51 PM@pytest.mark.integration
(defined in the projectA
directory):
$ ./pants test :: --pytest-args='-m "integration"'
✓ projectA/tests/test_module.py:../projectA_tests succeeded.
𐄂 projectB/tests/test_module.py:../tests failed.
𐄂 projectC/tests/test_module.py:../tests failed.
$ echo $?
5
The pytest docs say:
pytest now exits with status code 5 in situations where no tests were run at all, such as the directory given in the command line does not contain any tests or as result of a command line option filters all out all testsThis makes sense and I find this to be reasonable. However, users may find it slightly confusing to see the red crosses with the
"failed"
status in the Pants output. Do you think we should instead have some other status such as "skipped"
- I assume this happens because Pants thinks that pytest
commands returning any other code than 0 have failed.astonishing-london-2419
10/04/2021, 2:03 PMfresh-cat-90827
10/04/2021, 2:05 PMfresh-cat-90827
10/04/2021, 2:06 PMfailed
despite not having any tests run…curved-television-6568
10/04/2021, 2:21 PM