https://github.com/meshy/colour-runner
Colour formatting for unittest output
https://github.com/meshy/colour-runner
Last synced: 4 months ago
JSON representation
Colour formatting for unittest output
- Host: GitHub
- URL: https://github.com/meshy/colour-runner
- Owner: meshy
- License: mit
- Created: 2014-03-03T00:21:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-05T09:33:26.000Z (almost 7 years ago)
- Last Synced: 2025-03-20T17:01:50.581Z (4 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 33
- Watchers: 4
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# colour-runner
Colour formatting for `unittest` test output.
## Installation
pip install colour-runner
### Django
Mix the `ColourRunnerMixin` into your `unittest` test runner (eg: in `project/runner.py`):
from django.test.runner import DiscoverRunner # Django 1.6's default
from colour_runner.django_runner import ColourRunnerMixinclass MyTestRunner(ColourRunnerMixin, DiscoverRunner):
passPoint django at it in `settings.py`:
TEST_RUNNER = 'project.runner.MyTestRunner'
You can also disable colour runner for an individual test run with Django's `--no-color` flag:
manage.py test --no-color
### Other Python
Where you would normally use:
* `unittest.TextTestRunner`, use `colour_runner.runner.ColourTextTestRunner`.
* `unittest.TextTestResult`, use `colour_runner.result.ColourTextTestResult`.