On , I learnt ...

That Pytest’s “keyword expression” filtering supports Python conditionals

When using Pytest’s -k filtering, you can use Python expressions to combine separate search terms. For example:

$ pytest -k "TestSomeUnit and not test_foo"

will run all tests in a class matching TestSomeUnit but not those with method name matching test_foo.

See the Pytest docs on specifying which tests to run for more.