diff options
author | Irit Katriel <iritkatriel@yahoo.com> | 2020-10-19 21:27:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 21:27:16 (GMT) |
commit | fa8748271a61177e9bf609921fa464cc6990478b (patch) | |
tree | 2bca7d663d2a1fa532c6a097d363a1454b5ba91a /Doc/library/unittest.rst | |
parent | 96ddc58281d2b6b2258b1a628bccf252090d5611 (diff) | |
download | cpython-fa8748271a61177e9bf609921fa464cc6990478b.zip cpython-fa8748271a61177e9bf609921fa464cc6990478b.tar.gz cpython-fa8748271a61177e9bf609921fa464cc6990478b.tar.bz2 |
bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740)
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index f04ec91..51e1011 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -593,8 +593,9 @@ The following decorators and exception implement test skipping and expected fail .. decorator:: expectedFailure - Mark the test as an expected failure. If the test fails it will be - considered a success. If the test passes, it will be considered a failure. + Mark the test as an expected failure or error. If the test fails or errors + it will be considered a success. If the test passes, it will be considered + a failure. .. exception:: SkipTest(reason) @@ -1967,7 +1968,7 @@ Loading and running tests A list containing 2-tuples of :class:`TestCase` instances and strings holding formatted tracebacks. Each tuple represents an expected failure - of the test case. + or error of the test case. .. attribute:: unexpectedSuccesses @@ -2093,8 +2094,8 @@ Loading and running tests .. method:: addExpectedFailure(test, err) - Called when the test case *test* fails, but was marked with the - :func:`expectedFailure` decorator. + Called when the test case *test* fails or errors, but was marked with + the :func:`expectedFailure` decorator. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`expectedFailures` attribute, where *formatted_err* |