A simple check runner for Python
Project description
A very simple check runner for Python. I use this in projects where I need to run a suite of checks before performing some action (usually on invocation).
Usage
Create a sub-class of CheckRunner and declare your checks:
from checkrunner import CheckRunner class MyChecks(CheckRunner): @classmethod def check_that_passes(cls): return True, 'this check passed!' @classmethod def check_that_fails(cls): return False, 'this check failed!' print(MyChecks.run()) # (False, ['this check failed!']) print(MyChecks.run(return_passed=True)) # (False, ['this check passed!', 'this check failed!'])
When all checks pass it will return True with an empty list (unless you set return_passed):
from checkrunner import CheckRunner class MyChecks(CheckRunner): @classmethod def check_that_passes(cls): return True, 'this check passed!' print(MyChecks.run()) # (True, [])
And that’s it!
Testing
tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
checkrunner-0.0.1.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for checkrunner-0.0.1.macosx-10.12-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 637ea06fe44e019d20062208b4d079d7e720f7cf906b635f356bca5568d5d1b9 |
|
MD5 | 458e2903233d23e166bcd0779a3de376 |
|
BLAKE2b-256 | 72dd08a1fa40235d5731e21e6265890fce2d07f36b0e3ce3b303d2d97a7057ff |
Close
Hashes for checkrunner-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bef28e1da3b9c9a506ae866bcb83ebd92aa95fa4bd5c912e01eeee70560988b |
|
MD5 | 6a6834ee8e2942ce0684c09f6c14cefc |
|
BLAKE2b-256 | 2d6075563054b7fc7b74f977b2644bc45b2af06c71381d9520cc2d0e72d4f211 |