Look and feel variations
pytest-sugar
pytest-sugar is a plugin that improves the look-n-feel, adds a
progressbar, and show tests that fail and the assert instantly. It gets activated automatically upon installation.
bash
pip install pytest-sugar
To run tests without it, run:
bash
pytest -p no:sugar
or uninstall it.
Report each sub-test name and its progress
For a single or a group of tests via pytest (after pip install pytest-pspec):
bash
pytest --pspec tests/test_optimization.py
Instantly shows failed tests
pytest-instafail shows failures and errors instantly instead of
waiting until the end of test session.
bash
pip install pytest-instafail
bash
pytest --instafail
To GPU or not to GPU
On a GPU-enabled setup, to test in CPU-only mode add CUDA_VISIBLE_DEVICES="":
bash
CUDA_VISIBLE_DEVICES="" pytest tests/test_logging.py
