hey team. I am wondering how Pants deal with `pyte...
# general
f
hey team. I am wondering how Pants deal with
pytest
skipping the tests when they are selected with markers?
Running this command and having a single test decorated with
@pytest.mark.integration
(defined in the
projectA
directory):
Copy code
$ ./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 tests
This 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.
👍 1
a
I asked a similar question, this thread may be of use -> https://pantsbuild.slack.com/archives/C046T6T9U/p1630331953075000
f
thanks @astonishing-london-2419 that’s perfect
would still love the thoughts of others on having those test modules reporting
failed
despite not having any tests run…
c
I think it would make sense to present pytest exit code 5 as skipped in the UI.. https://docs.pytest.org/en/latest/reference/exit-codes.html