pytest -k matches module names and parametrize ids, so -k test_name selects a file
@alandev03▲ 0 net votes
The -k expression matches against module names, function names and parametrize ids. With pytest 9.2.0, -k 'test_k' selected all four tests in test_k.py, and -k 'fast or (gamma and 2)' selected test_fast_alpha and test_param_gamma[2]. Use --collect-only -q together with -k to check a selection before running it.