module documentation

Undocumented

Class DebugSQLTextTestResult Undocumented
Class DiscoverRunner A Django test runner that uses unittest2 test discovery.
Class DummyList Dummy list class for faking storage of results in unittest.TestResult.
Class ParallelTestSuite Run a series of tests in parallel in several processes.
Class PDBDebugResult Custom result class that triggers a PDB session when an error or failure occurs.
Class RemoteTestResult Extend unittest.TestResult to record events in the child processes so they can be replayed in the parent process. Events include things like which tests succeeded or failed.
Class RemoteTestRunner Run tests and record everything but don't display anything.
Class Shuffler This class implements shuffling with a special consistency property. Consistency means that, for a given seed and key function, if two sets of items are shuffled, the resulting order will agree on the intersection of the two sets...
Function filter_tests_by_tags Return the matching tests as an iterator.
Function find_top_level Undocumented
Function get_max_test_processes The maximum number of test processes when using the --parallel option.
Function parallel_type Parse value passed to the --parallel option.
Function partition_suite_by_case Partition a test suite by test case, preserving the order of tests.
Function reorder_test_bin Return an iterator that reorders the given tests, keeping tests next to other tests of their class.
Function reorder_tests Reorder an iterable of tests, grouping by the given TestCase classes.
Function shuffle_tests Return an iterator over the given tests in a shuffled order, keeping tests next to other tests of their class.
Function test_match_tags Undocumented
Function try_importing Try importing a test label, and return (is_importable, is_package).
Function _class_shuffle_key Undocumented
Function _init_worker Switch to databases dedicated to this worker.
Function _process_setup_stub Stub method to simplify run() implementation.
Function _run_subsuite Run a suite of tests with a RemoteTestRunner and return a RemoteTestResult.
Variable _worker_id Undocumented
def filter_tests_by_tags(tests, tags, exclude_tags): (source)

Return the matching tests as an iterator.

def find_top_level(top_level): (source)

Undocumented

def get_max_test_processes(): (source)

The maximum number of test processes when using the --parallel option.

def parallel_type(value): (source)

Parse value passed to the --parallel option.

def partition_suite_by_case(suite): (source)

Partition a test suite by test case, preserving the order of tests.

def reorder_test_bin(tests, shuffler=None, reverse=False): (source)

Return an iterator that reorders the given tests, keeping tests next to other tests of their class. `tests` should be an iterable of tests that supports reversed().

def reorder_tests(tests, classes, reverse=False, shuffler=None): (source)

Reorder an iterable of tests, grouping by the given TestCase classes. This function also removes any duplicates and reorders so that tests of the same type are consecutive. The result is returned as an iterator. `classes` is a sequence of types. Tests that are instances of `classes[0]` are grouped first, followed by instances of `classes[1]`, etc. Tests that are not instances of any of the classes are grouped last. If `reverse` is True, the tests within each `classes` group are reversed, but without reversing the order of `classes` itself. The `shuffler` argument is an optional instance of this module's `Shuffler` class. If provided, tests will be shuffled within each `classes` group, but keeping tests with other tests of their TestCase class. Reversing is applied after shuffling to allow reversing the same random order.

def shuffle_tests(tests, shuffler): (source)

Return an iterator over the given tests in a shuffled order, keeping tests next to other tests of their class. `tests` should be an iterable of tests.

def test_match_tags(test, tags, exclude_tags): (source)

Undocumented

def try_importing(label): (source)

Try importing a test label, and return (is_importable, is_package). Relative labels like "." and ".." are seen as directories.

def _class_shuffle_key(cls): (source)

Undocumented

def _init_worker(counter, initial_settings=None, serialized_contents=None, process_setup=None, process_setup_args=None, debug_mode=None): (source)

Switch to databases dedicated to this worker. This helper lives at module-level because of the multiprocessing module's requirements.

def _process_setup_stub(*args): (source)

Stub method to simplify run() implementation.

def _run_subsuite(args): (source)

Run a suite of tests with a RemoteTestRunner and return a RemoteTestResult. This helper lives at module-level and its arguments are wrapped in a tuple because of the multiprocessing module's requirements.

_worker_id: int = (source)

Undocumented