Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

23.3.6 TestSuite Objects


23.3.6 TestSuite Objects

TestSuite objects behave much like TestCase objects, except they do not actually implement a test. Instead, they are used to aggregate tests into groups of tests that should be run together. Some additional methods are available to add tests to TestSuite instances:

addTest( test)
Add a TestCase or TestSuite to the suite.

addTests( tests)
Add all the tests from an iterable of TestCase and TestSuite instances to this test suite.

This is equivalent to iterating over tests, calling addTest() for each element.

TestSuite shares the following methods with TestCase:

run( result)
Run the tests associated with this suite, collecting the result into the test result object passed as result. Note that unlike TestCase.run(), TestSuite.run() requires the result object to be passed in.

debug( )
Run the tests associated with this suite without collecting the result. This allows exceptions raised by the test to be propagated to the caller and can be used to support running tests under a debugger.

countTestCases( )
Return the number of tests represented by this test object, including all individual tests and sub-suites.

In the typical usage of a TestSuite object, the run() method is invoked by a TestRunner rather than by the end-user test harness.

See About this document... for information on suggesting changes.
Les développeurs logiciels actifs sont actuellement estimés à un peu moins de 19 millions dans le monde, 13 millions d'entre eux seraient des pros
Voici l'état de l'écosystème des développeurs en 2019 : l'évolution du monde du code, d'après une enquête menée par Jetbrains
Python 3.8.0 : un aperçu des fonctionnalités attendues pour la version stable du langage de programmation
Apprendre Python et s'initier à la programmation - Partie 2 : Programmation avancée, un cours de Sébastien Combéfis
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web