summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-12-31 18:48:28 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-12-31 18:48:28 +0000
commit9a554322139e5c65b4b40bc538ca263a922c824f (patch)
tree03e39c68e3fb1b670a4bc0053ffb9a5ef0f8940d /docs
parentc35868ab9b4eca17b284cb6edd79fcdad9951442 (diff)
Fixed #12364: Added graceful exit from a test run when Ctrl-C is pressed. Thanks Randy Barlow.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12034 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/django-admin.txt6
-rw-r--r--docs/releases/1.2.txt10
-rw-r--r--docs/topics/testing.txt21
3 files changed, 27 insertions, 10 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index 2cd879423c..88715ebdc7 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -812,12 +812,10 @@ test <app or test identifier>
Runs tests for all installed models. See :ref:`topics-testing` for more
information.
---failfast
-~~~~~~~~~~
-
.. versionadded:: 1.2
+.. django-admin-option:: --failfast
-Use the ``--failfast`` option to stop running tests and report the failure
+Use the :djadminopt:`--failfast` option to stop running tests and report the failure
immediately after a test fails.
testserver <fixture fixture ...>
diff --git a/docs/releases/1.2.txt b/docs/releases/1.2.txt
index 8810963eaa..252682a3cf 100644
--- a/docs/releases/1.2.txt
+++ b/docs/releases/1.2.txt
@@ -471,10 +471,12 @@ Models can now use a 64 bit :class:`~django.db.models.BigIntegerField` type.
Fast Failure for Tests
----------------------
-The ``test`` subcommand of ``django-admin.py``, and the ``runtests.py`` script
-used to run Django's own test suite, support a new ``--failfast`` option.
-When specified, this option causes the test runner to exit after
-encountering a failure instead of continuing with the test run.
+The :djadmin:`test` subcommand of ``django-admin.py``, and the ``runtests.py``
+script used to run Django's own test suite, support a new ``--failfast`` option.
+When specified, this option causes the test runner to exit after encountering
+a failure instead of continuing with the test run. In addition, the handling
+of ``Ctrl-C`` during a test run has been improved to trigger a graceful exit
+from the test run that reports details of the tests run before the interruption.
Improved localization
---------------------
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
index 9ef6cceae8..f4881e2e32 100644
--- a/docs/topics/testing.txt
+++ b/docs/topics/testing.txt
@@ -242,8 +242,8 @@ in different circumstances.
Running tests
=============
-Once you've written tests, run them using your project's ``manage.py``
-utility::
+Once you've written tests, run them using the :djadmin:`test` subcommand of
+your project's ``manage.py`` utility::
$ ./manage.py test
@@ -274,6 +274,23 @@ a test case, add the name of the test method to the label::
$ ./manage.py test animals.AnimalTestCase.testFluffyAnimals
+.. versionadded:: 1.2
+ You can now trigger a graceful exit from a test run by pressing ``Ctrl-C``.
+
+If you press ``Ctrl-C`` while the tests are running, the test runner will
+wait fur the currently running test to complete and then exit gracefully.
+During a graceful exit the test runner will output details of any test
+failures, report on how many tests were run and how many errors and failures
+were encountered, and destroy any test databases as usual. Thus pressing
+``Ctrl-C`` can be very useful if you forget to pass the :djadminopt:`--failfast`
+option, notice that some tests are unexpectedly failing, and want to get details
+on the failures without waiting for the full test run to complete.
+
+If you do not want to wait for the currently running test to finish, you
+can press ``Ctrl-C`` a second time and the test run will halt immediately,
+but not gracefully. No details of the tests run before the interruption will
+be reported, and any test databases created by the run will not be destroyed.
+
The test database
-----------------