Why
Because unit testing is way more fun
- when you don't have to switch out of your editor to get feedback from unit tests.
- when the feedback period from a change to feedback from your tests is shorter.
I've seen the usefullness of a tool like this when toying with rubys autotest command, but didn't like the complications of getting that highly optimized code to work with setups like VMs and Docker Containers where file system notifications don't reliably work.
So this skips all the optimizations and just uses the simplest possible algorithm - iterate all files and see what changed. And that works surprisingly well.
In addition to that it's dead simple, has no dependencies and is really small.
Usage
% watching_testrunner --help
Usage: watching_testrunner [options] [--] command [arguments...]
Options:
-h, --help show this help message and exit
-b BASEPATH, --basepath=BASEPATH
base path to watch for changes
-p WATCH_WILDCARD, --pattern=WATCH_WILDCARD
glob-style pattern for file names to watch
Examples
$ watching_testrunner nosetests
This will run nosetests whenever any python file below the current directory changes
$ watching_testrunner -- nosetests $NOSETESTS_ARGUMENTS
Will run nosetests all the same, but will not try to parse any of the nosetests arguments.
$ watching_testrunner --basepath foo/bar --pattern="*" nosetests $NOSETESTS_ARGUMENTS
This will run nosetests whenever any file below ./foo/bar changes.
$ watching_testrunner --basepath path/to/js_tests --pattern="*.js" jasmine --console
This will run jasmine --console whenever any js file below ./path/to/js_tests changes (i.e. you
can use the watching testrunner to get auto test execution using any tool for any language)
Many thanks to
- Felix Schwarz for the original implementation after me pestering him about this idea
- Tony Narlock for prompting me to port this to python 3, hosting it on his account and caring for it's continued development
Metadata
Release files for watching-testrunner 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| watching_testrunner-1.2.2.tar.gz | 4.4 kB | Without provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| watching_testrunner-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
| watching_testrunner-1.2.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.9 kB
Release files / watching_testrunner-1.2.2.tar.gz
| Download URL | watching_testrunner-1.2.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5677e007fdb1a5e7d20bcc8b80e06ba1ccd4062002cd1b03ee41169cf9859f77
|
|
BLAKE2b-256 checksum How to use checksums |
556c69aa0bf1ae51e284849049da62ff9cc2a8a9aa5bbe07e0ff8f220d52b440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / watching_testrunner-1.2.2-py3-none-any.whl
| Download URL | watching_testrunner-1.2.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f061a0ab9f72297a40ef89a3fb970712838dfbc17116965e5293df0d47359d99
|
|
BLAKE2b-256 checksum How to use checksums |
093925f6f83ddf2c8ea2a28bcb56db56538420b636385d4a8dc1c607e8c887ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / watching_testrunner-1.2.2-py2.py3-none-any.whl
| Download URL | watching_testrunner-1.2.2-py2.py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
327838728513e2ecdd9154348a5683d4d2e6d5ed4fdd1472ee1016f8407adbb0
|
|
BLAKE2b-256 checksum How to use checksums |
710d743ab6536312728c07f467f28c17d0e1f136a39dfdc477127f869af2f4ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for watching-testrunner 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.