Skip to main content

Testrunner for django which covers html report and code coverage

Project description

anfema-django-testutils

The main intention of the anfema_django_testutils app is to provide a Django test runner which considers snapshot tests as well as code coverage and human-readable html test reports. Moreover, the test result Precondition Failure has been added.

This package integrates snapshottest as well as coverage.

Links

Prerequisites

anfema_django_testutils is officially supported on:

  • Python >= 3.9
  • Django >= 3.2

Installation

$ pip install anfema-django-testutils

Setting up

Update your Django settings.py to use the anfema_django_testutils test runner:

# settings.py

INSTALLED_APPS = [
    ...
    "mathfilters",
    "anfema_django_testutils",
]

TEST_RUNNER = "anfema_django_testutils.runner.TestRunner"

For further information see the anfema_django_testutils documentation.

Usage

For writing test cases use the anfema_django_testutils.testcases.TestCase rather than the django.test.TestCase:

# app/tests.py

from anfema_django_testutils.testcases import TestCase


class CustomTest(TestCase):
    ...

Create documentation

To generate the anfema_django_testutils documentation from the local sources, run in a terminal:

$ pip install tox
$ tox -e docs -- docs/build

Run tests

To execute the anfema_django_testutils tests, run in a terminal:

$ pip install tox
$ tox

License

Licensed under the MIT-clause license; see LICENSE for details.

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

anfema_django_testutils-0.8.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

anfema_django_testutils-0.8.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file anfema_django_testutils-0.8.0.tar.gz.

File metadata

File hashes

Hashes for anfema_django_testutils-0.8.0.tar.gz
Algorithm Hash digest
SHA256 84c4a6dc5a3440de81396d3b3f3d88ea29fb6b2f2c01c75c85c397bb41747323
MD5 a9a1e052c1f88a00bc47a020873552ce
BLAKE2b-256 6e2e7aebbc64b9250dcb750ef17046ff32216cae530b5fbf3ce56ce32b41283b

See more details on using hashes here.

File details

Details for the file anfema_django_testutils-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for anfema_django_testutils-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f87c828cb49cbdfd14679fb7e1a180790745008295459a14d00a2500fc600054
MD5 cd6bd8fbb2026428827977f1b2979593
BLAKE2b-256 a94761739b7c5caeaba7a8a27ab35434a9076a8b013fd93d18f8677775798807

See more details on using hashes here.

Supported by

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