Skip to main content

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

Limitations:
  • 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.

Installation

pip install pytest-test-this

Usage

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

Release files for pytest-test-this 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-test-this 0.3.0
File Size Uploaded
pytest-test-this-0.3.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-test-this 0.3.0
File Interpreter ABI Platform
pytest_test_this-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / pytest-test-this-0.3.0.tar.gz

Download URL pytest-test-this-0.3.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ae5ec35b302966818d6e640e9a9f6ef3d2f36091dde378897597c8d440464754
BLAKE2b-256 checksum
How to use checksums
85fc15d8462f6707c787234f67d19daeb6f00c4a3e93c038e386edb019d9a4b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release files / pytest_test_this-0.3.0-py3-none-any.whl

Download URL pytest_test_this-0.3.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
983b175bc570fca09006e362b2996c790109eaceef795d1ab9fe94684ce2e8da
BLAKE2b-256 checksum
How to use checksums
0f065ed8db3e0b0ee7e0f1dbf733090e3284666814d8cced254d2e2d714999de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page