Skip to content

Commit fa87482

Browse files
authored
bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740)
1 parent 96ddc58 commit fa87482

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/library/unittest.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,9 @@ The following decorators and exception implement test skipping and expected fail
593593

594594
.. decorator:: expectedFailure
595595

596-
Mark the test as an expected failure. If the test fails it will be
597-
considered a success. If the test passes, it will be considered a failure.
596+
Mark the test as an expected failure or error. If the test fails or errors
597+
it will be considered a success. If the test passes, it will be considered
598+
a failure.
598599

599600
.. exception:: SkipTest(reason)
600601

@@ -1967,7 +1968,7 @@ Loading and running tests
19671968

19681969
A list containing 2-tuples of :class:`TestCase` instances and strings
19691970
holding formatted tracebacks. Each tuple represents an expected failure
1970-
of the test case.
1971+
or error of the test case.
19711972

19721973
.. attribute:: unexpectedSuccesses
19731974

@@ -2093,8 +2094,8 @@ Loading and running tests
20932094

20942095
.. method:: addExpectedFailure(test, err)
20952096

2096-
Called when the test case *test* fails, but was marked with the
2097-
:func:`expectedFailure` decorator.
2097+
Called when the test case *test* fails or errors, but was marked with
2098+
the :func:`expectedFailure` decorator.
20982099

20992100
The default implementation appends a tuple ``(test, formatted_err)`` to
21002101
the instance's :attr:`expectedFailures` attribute, where *formatted_err*

0 commit comments

Comments
 (0)