Skip to main content

A colorful Django Test Runner.

Project description

django-rainbowtests

PyPI version License CI

This is a custom test runner for Django that gives you really colorful test output.

Installation

Install the latest release with:

pip install django-rainbowtests

Or with uv:

uv add django-rainbowtests

Usage

Set your test runner in Django settings:

TEST_RUNNER = 'rainbowtests.test.runner.RainbowDiscoverRunner'

Then run your tests as usual:

python manage.py test

Settings

RAINBOWTESTS_HIGHLIGHT_PATH

While running your tests, any lines in your tracebacks that match this path will be highlighted, making them easier to find and read. If you omit this setting, the default is to use the path to your Django installation.

RAINBOWTESTS_HIGHLIGHT_PATH = '/path/to/my/project/'

RAINBOWTESTS_SHOW_MESSAGES

If the test output is too verbose and you just want a colorful version of the standard Django test output, set RAINBOWTESTS_SHOW_MESSAGES to False:

RAINBOWTESTS_SHOW_MESSAGES = False

Python/Django Compatibility

  • Python: 3.10, 3.11, 3.12, 3.13, 3.14
  • Django: 4.2, 5.2

Coverage

There is support for coverage via a custom test runner:

TEST_RUNNER = 'rainbowtests.test.runner.RainbowDiscoverCoverageRunner'

Run your tests as normal (python manage.py test), and if you have coverage installed, you should see a report when your tests complete.

Note: The recommended modern workflow is to use coverage run manage.py test directly, which gives you more control over coverage settings.

Development

This project uses uv for dependency management.

# Clone the repository
git clone https://github.com/bradmontgomery/django-rainbowtests.git
cd django-rainbowtests

# Install dependencies
uv sync --group dev --group test

# Run tests
uv run pytest

# Run linter
uv run ruff check .

License

MIT. See LICENSE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_rainbowtests-0.7.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_rainbowtests-0.7.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file django_rainbowtests-0.7.0.tar.gz.

File metadata

  • Download URL: django_rainbowtests-0.7.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_rainbowtests-0.7.0.tar.gz
Algorithm Hash digest
SHA256 9af8a45268af4000f94e7f77c30af00f21f1198420549fa59d81096907cadb22
MD5 a3f1eda1c46adc376f5b47995968385c
BLAKE2b-256 36c3b8116ed9c781baec243536a85a259cec294dc7849373857e1aeb6e81ff5a

See more details on using hashes here.

File details

Details for the file django_rainbowtests-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_rainbowtests-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9540fb78010ab09a9a5c29d4f23d28d787d34879f4561b782db3c24d47db03b4
MD5 e320c3831d542f34464ae79cce20d6e2
BLAKE2b-256 a30af907060a9eea833e5a6e015719d5633fa66157fbcbbad7676cacb5bc2578

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page