We basically have two different needs of our testing architecture: light, and comprehensive.
Only tests optional features if they're available. On some platforms they might not, or it could be a lack of an installed library. Whatever the reason, testing ignores unavailable features entirely, testing only standard code and available optional features.
Useful for end-user installations.
Expects every bell and whistle to be available, and tosses up errors otherwise. Called by tox/Travis-CI as part of a cross-Python-version campaign of ultimate testing completion.
Useful for developers, who don't want to accidentally break things, even if they don't use them.
We only serve the comprehensive need. We need a way to support both.
Change ejtp.tests.runner to optionally take an “all” positional argument. If the argument is present, do comprehensive testing. If not, do light testing. Adjust tox config to call with “all” parameter.
Comprehensive testing workflow (unchanged):
Light testing workflow:
$ python setup.py build $ sudo python setup.py install $ doctestall ejtp $ python -m ejtp.tests.runner
Which you can optionally chain together with
&& in your shell.
In order to carry that state where it needs to be carried, create a new module to hold it (ejtp.tests.mode) with property current_mode set to “light”. To turn on comprehensive mode from runner.py, import ejtp.tests.mode and set current_mode to “comprehensive”.
Then in modules with optional features, you can import ejtp.tests.mode, and determine current test mode by its current_mode property.
DONE / Accepting payments