pytest-delta
is a plugin to run your tests only when selected files are changed.
pip install pytest-delta
from pytest_delta import skip_if_files_have_not_changed
@skip_if_files_have_not_changed(files=["my_specific_file.py"])
def test_should_do_whatever():
print("Runnint the test")
You can use the envvar PYTEST_DELTA_TESTING_ENABLED
to enable or disable pytest decorators
export PYTEST_DELTA_TESTING_ENABLED=True
export PYTEST_DELTA_TESTING_ENABLED=False
We'd love you to contribute to pytest-delta 🥳🥳🥳🥳🥳🥳️️!
For more information, check our documentation