HotRunner is a Django test runner with useful features, like excluding apps and displaying running times of individual tests.
Homepage Repository PyPI Python
pip install django-hotrunner==0.2.4
#########
HotRunner
#########
HotRunner is an improved django test runner.
To install HotRunner, ``pip install django-hotrunner``.
To use HotRunner, set ``TEST_RUNNER = 'hotrunner.HotRunner'`` in your django
settings file. This enables three useful features:
* **Test exclusion:** None of the ``django.contrib`` tests will be run when
you run your test suite. Neither will any apps you specify in the
``EXCLUDED_TEST_APPS`` setting. You can override this without deleting
your ``EXCLUDED_TEST_APPS``, by setting ``TEST_ALL_APPS`` to a true value.
``django.contrib`` apps will still not be run. To run them, specify them
by name on the manage.py command line:
``python manage.py test django.contrib.auth``
* **Copy-paste friendly test naming:** HotRunner now identifies tests with a
name that can be copied and pasted to rerun that test.
* **Test timing:** Find out how long each test is running simply by setting
your verbosity to 2 or higher. The time it takes to run each successful
test will be reported at microsecond granularity::
$ python manage.py test --verbosity=2
test_absolute_url (news.NewsModelAbsoluteURLTestCase.test_absolute_url) ... (0.106085s) ok
test_empty_body_returns_empty_html (news.NewsModelMarkdownTestCase.test_empty_body_returns_empty_html) ... (0.000119s) ok
test_markdown_saved_to_html (news.NewsModelMarkdownTestCase.test_markdown_saved_to_html) ... (0.009840s) ok
test_unicode_markdown_converted_appropriately (news.NewsModelMarkdownTestCase.test_unicode_markdown_converted_appropriately) ... (0.000501s) ok
test_unicode_strings_must_be_decoded (news.NewsModelMarkdownTestCase.test_unicode_strings_must_be_decoded) ... (0.000384s) ok
test_basic_slug_creation (news.NewsModelSlugificationTestCase.test_basic_slug_creation) ... (0.000609s) ok
test_existing_slugs_do_not_get_overridden (news.NewsModelSlugificationTestCase.test_existing_slugs_do_not_get_overridden) ... (0.000254s) ok
test_getting_conflicting_slugs (news.NewsModelSlugificationTestCase.test_getting_conflicting_slugs) ... (0.001476s) ok
test_slugifying_disambiguates_slugs (news.NewsModelSlugificationTestCase.test_slugifying_disambiguates_slugs) ... (0.000204s) ERROR
Tests that get skipped will not report time, as the information is not
relevant.
* XUnit style XML output. If you set ``HOTRUNNER_XUNIT_FILENAME`` to the path
to a writeable file, HotRunner will write an XML document of test results to
that file. This makes it easy to integrate your project with, for instance,
a Jenkins continuous integration job. For example, the test suite above
would look like this (minus the pretty formatting)::