diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2021-11-04 15:31:26 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-08 20:19:21 +0100 |
| commit | 91acfc3514280370535f1dd6bebee57760bac7b9 (patch) | |
| tree | 7620a17204f1fb1cf8cc236d7d97652f56885bc5 /docs | |
| parent | 1a5023883bf4c8cccb34a830edcc3c82aa862455 (diff) | |
Fixed #33264 -- Made test runner return non-zero error code for unexpected successes.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/4.1.txt | 3 | ||||
| -rw-r--r-- | docs/topics/testing/overview.txt | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt index ff1c59c852..be028f0623 100644 --- a/docs/releases/4.1.txt +++ b/docs/releases/4.1.txt @@ -260,6 +260,9 @@ Miscellaneous :class:`~django.contrib.contenttypes.fields.GenericRelation` are now cached on the :class:`~django.db.models.Model` instance to which they belong. +* The Django test runner now returns a non-zero error code for unexpected + successes from tests marked with :py:func:`unittest.expectedFailure`. + .. _deprecated-features-4.1: Features deprecated in 4.1 diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt index cc55224761..3c45d509ae 100644 --- a/docs/topics/testing/overview.txt +++ b/docs/topics/testing/overview.txt @@ -331,10 +331,15 @@ but it's pretty intuitive. You can consult the documentation of Python's :mod:`unittest` library for details. Note that the return code for the test-runner script is 1 for any number of -failed and erroneous tests. If all the tests pass, the return code is 0. This +failed tests (whether the failure was caused by an error, a failed assertion, +or an unexpected success). If all the tests pass, the return code is 0. This feature is useful if you're using the test-runner script in a shell script and need to test for success or failure at that level. +.. versionchanged:: 4.1 + + In older versions, the return code was 0 for unexpected successes. + .. _speeding-up-tests-auth-hashers: Speeding up the tests |
