Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boxed/pytest-test-this
Plugin for pytest to run relevant tests, by naively checking if a test contains a reference to the symbol you supply
https://github.com/boxed/pytest-test-this
Last synced: 2 months ago
JSON representation
Plugin for pytest to run relevant tests, by naively checking if a test contains a reference to the symbol you supply
- Host: GitHub
- URL: https://github.com/boxed/pytest-test-this
- Owner: boxed
- License: bsd-3-clause
- Created: 2019-09-13T13:13:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-15T14:37:22.000Z (over 5 years ago)
- Last Synced: 2024-10-01T10:05:20.099Z (3 months ago)
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
===============================
pytest-test-this
===============================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 foundThis 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 against based on a `git diff` and run pytest-test-this against those symbols