In my Python project, we have a big number of unit tests (some thousands). Though they are logically distributed between files and classes, I need sometimes a lot of time in order to find ones, which cover the functionality I'm changing.
Of course, I can run all test from some specific file/class, but again because of big number of that tests, It'll be time-consuming to run them continuously (I'm executing unit tests each time after saving a file in my IDE).
So in general I need some solution which will do following activities at a time:
Does anyone have idea about something similar?
You might like to checkout pytest-incremental:
The idea is to execute your tests faster by executing not all of them but only the “required” ones.
Install via pypi:
pip install pytest-incremental
Usage:
$ py.test --inc
I think it does what you are looking for, it "looks for imports recursively to find dependencies (using AST)" and runs only the changed tests.
pytest-testmon is a pytest plugin which selects only tests affected by changes since last execution. It uses Coverage.py to track individual tests dependencies and and compares and saves checksums of methods on each execution.
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