Skip to main content

reorder_test_bin

Return an iterator that reorders the given tests, keeping tests next to other tests of their class.

def reorder_test_bin(
tests: iterable,
shuffler: callable,
reverse: boolean = False
) - > iterator

Return an iterator that reorders the given tests, keeping tests next to other tests of their class.

Parameters

NameTypeDescription
testsiterableAn iterable of test cases to be reordered; must support the reversed() function.
shufflercallableAn optional function used to randomize the order of the tests while maintaining class grouping.
reverseboolean = FalseA flag that, when set to True, reverses the final order of the tests.

Returns

TypeDescription
iteratorAn iterator yielding the reordered test cases, optionally shuffled or reversed.