Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « unittest » Python 3.11.3

Classe « TestResult »

Informations générales

Héritage

builtins.object
    TestResult

Définition

class TestResult(builtins.object):

help(TestResult)

Holder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    

Constructeur(s)

Signature du constructeur Description
__init__(self, stream=None, descriptions=None, verbosity=None)

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__repr__(self)
addError(self, test, err) Called when an error has occurred. 'err' is a tuple of values as [extrait de addError.__doc__]
addExpectedFailure(self, test, err) Called when an expected failure/error occurred. [extrait de addExpectedFailure.__doc__]
addFailure(self, test, err) Called when an error has occurred. 'err' is a tuple of values as [extrait de addFailure.__doc__]
addSkip(self, test, reason) Called when a test is skipped. [extrait de addSkip.__doc__]
addSubTest(self, test, subtest, err) Called at the end of a subtest. [extrait de addSubTest.__doc__]
addSuccess(self, test) Called when a test has completed successfully [extrait de addSuccess.__doc__]
addUnexpectedSuccess(self, test) Called when a test was expected to fail, but succeed. [extrait de addUnexpectedSuccess.__doc__]
printErrors(self) Called by TestRunner after test run [extrait de printErrors.__doc__]
startTest(self, test) Called when the given test is about to be run [extrait de startTest.__doc__]
startTestRun(self) Called once before any tests are executed. [extrait de startTestRun.__doc__]
stop(self) Indicates that the tests should be aborted. [extrait de stop.__doc__]
stopTest(self, test) Called when the given test has been run [extrait de stopTest.__doc__]
stopTestRun(self) Called once after all tests are executed. [extrait de stopTestRun.__doc__]
wasSuccessful(self) Tells whether or not this result was a success. [extrait de wasSuccessful.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__