Skip to main content

iter_test_cases

Return an iterator over a test suite's unittest.TestCase objects.

The tests argument can also be an iterable of TestCase objects.

def iter_test_cases(
tests: iterable
) - > iterator

Return an iterator over a test suite's unittest.TestCase objects.

Parameters

NameTypeDescription
testsiterableA unittest.TestSuite or an iterable containing TestCase objects or nested suites to be flattened.

Returns

TypeDescription
iteratorAn iterator yielding individual unittest.TestCase objects extracted from the provided suite or iterable.