I am working with pytest and I need to collect test cases. For this there exists the following command:
pytest --collect-only -q
I am only interested in the tests that would be actually executed, if I would perform for example:
pytest tests/my_tests
(and not the skipped ones). How can I avoid collecting the tests that would skip?
Invoke the mark filter on the command line:
pytest --collect-only -q -m "not skip"
This avoids having to create or modify a conftest.py
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With