Задать вопрос

Тел: +7 965 3737 888

501

Просмотров

3

Ответов

Syntax highlighting for tracebacks during tests

<p>This is hardcoded to use <a href="http://pypi.python.org/pypi/django-discover-runner">django-discover-runner</a> since that's my main test runner but could easily be adopted to use Django's own test runner. If you're using a terminal that is capable of showing 256 colors use the Terminal256Formatter formatter instead.</p>
<p>Enabled it with the TEST_RUNNER setting:</p>
TEST_RUNNER = 'dotted.path.to.highlighted.runner.HighlightedDiscoverRunner'

<p>Where dotted.path.to.highlighted.runner is the Python import path of the file you saved the runner in.</p>

Вопрос полезен? Да0/Нет0
file_3090.py(828.0б)
None

Ответы (3):

Ответjocelynd:10.02.2014
Ответ полезен? Да0/Нет0

as django-discover-runner now comes with django (since 1.6), you should replace

from discover_runner import DiscoverRunner

by

from django.test.runner import DiscoverRunner

Ответjezdez:22.10.2013
Ответ полезен? Да0/Нет0

This is now the standard test runner!

Ответvdboor:20.08.2012
Ответ полезен? Да0/Нет0

This would be really useful to have in the standard Django testrunner! :-)