mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-68437: Add TestCase.status attribute
This attribute can be used in teardown/cleanup phase to check status of the test being run.
This commit is contained in:
parent
0759cecd9d
commit
9200d2e4b9
5 changed files with 117 additions and 2 deletions
|
|
@ -1442,6 +1442,25 @@ Test cases
|
|||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
.. attribute:: status
|
||||
|
||||
This attribute contains resulting status of the single test run.
|
||||
This can be used to check the test status in :meth:`tearDown` and
|
||||
cleanup phase. Possible values are ``None`` or any of the values
|
||||
stored in ``unittest.TestStatus`` enum:
|
||||
|
||||
======================= =================================================
|
||||
Enum name Details
|
||||
======================= =================================================
|
||||
``SUCCESS`` Test succeeded.
|
||||
``UNEXPECTED_SUCCESS`` Test succeeded, but was expected to fail.
|
||||
``FAILED`` Test failed.
|
||||
``EXPECTED_FAILURE`` Test failed, as was expected.
|
||||
``SKIPPED`` Test was skipped.
|
||||
======================= =================================================
|
||||
|
||||
.. versionadded:: 3.14
|
||||
|
||||
|
||||
Testing frameworks can use the following methods to collect information on
|
||||
the test:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue