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:
Jan Musílek 2024-07-13 15:04:11 +02:00
parent 0759cecd9d
commit 9200d2e4b9
5 changed files with 117 additions and 2 deletions

View file

@ -49,14 +49,15 @@ def testMultiply(self):
'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
'expectedFailure', 'TextTestResult', 'installHandler',
'registerResult', 'removeResult', 'removeHandler',
'addModuleCleanup', 'doModuleCleanups', 'enterModuleContext']
'addModuleCleanup', 'doModuleCleanups', 'enterModuleContext',
'TestStatus']
__unittest = True
from .result import TestResult
from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip,
skipIf, skipUnless, expectedFailure, doModuleCleanups,
enterModuleContext)
enterModuleContext, TestStatus)
from .suite import BaseTestSuite, TestSuite # noqa: F401
from .loader import TestLoader, defaultTestLoader
from .main import TestProgram, main # noqa: F401