Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply

Project description

Plugin for pytest to run relevant tests by naively check if test functions contain a reference to the symbol supplied.

  • it only looks for top level test functions, so test classes won’t be discovered
  • very naive check, so indirect usages of a symbol won’t be found

This trade off has been made for speed. This method is extremely fast compared to the other common method which tries to be correct by running the full test suite under coverage and checking if the function was called directly or indirectly.


pip install pytest-test-this


pytest –test-this=foo

…where foo is the name of your function, class or variable. You can write multiple symbols comma separated.

There is also a special simplified mode for users of git:

pytest –test-this-git

this will try to automatically guess the symbols to run againsts based on a git diff and run pytest-test-this againsts those symbols

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-test-this, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size pytest_test_this-0.3.0-py3-none-any.whl (5.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytest-test-this-0.3.0.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page