python - Is there a way to start unit tests which related only to changed code? -


in python project, have big number of unit tests (some thousands). though logically distributed between files , classes, need lot of time in order find ones, cover functionality i'm changing.

of course, can run test specific file/class, again because of big number of tests, it'll time-consuming run them continuously (i'm executing unit tests each time after saving file in ide).

so in general need solution following activities @ time:

  • tracks files have been changed since last file saving
  • traces dependencies between code have been changed in files , unit tests cover code
  • selectively executes unit tests cover code has been affected

does have idea similar?

you might checkout pytest-incremental:

the idea execute tests faster executing not of them “required” ones.

install via pypi:

pip install pytest-incremental 

usage:

$ py.test --inc 

i think looking for, "looks imports recursively find dependencies (using ast)" , runs changed tests.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -