Skip to content

[3.9] bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) #22783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Doc/library/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -1946,7 +1947,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

Expand Down Expand Up @@ -2072,8 +2073,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*
Expand Down