ID EN
Unittest

__iter__

Python 3.11

Tests grouped by a TestSuite are always accessed by iteration. Subclasses can lazily provide tests by overriding __iter__(). Note that this method may be called several times on a single suite (for example when counting tests or comparing for equality) so the tests returned by repeated iterations before TestSuite.run() must be the same for each call iteration. After TestSuite.run(), callers should not rely on the tests returned by this method unless the caller uses a subclass that overrides TestSuite._removeTestAtIndex() to preserve test references.

Syntax

PYTHON
__iter__()

See Also

TestSuite TestSuite.run() TestSuite.run() TestSuite TestSuite TestCase TestSuite.run()