How To Filter Tests Effortlessly With Pytest -K Options
Have you ever had to wade through hundreds or thousands of tests to run a few specific ones?
Running pytest
in the terminal, executes ALL the tests which not only takes a long time, but is also inefficient.
Maybe you can run a test in a specific directory but that too carries overhead and is hard to do repeatedly for tests in different directories.
So how do you filter tests in Pytest? How can you tell Pytest to run only the tests you’re interested in? Something like a regular expression?