Skip to main content

get_runner

Instantiates and returns a test runner class based on the provided settings or a specific class path string. The function dynamically imports the module containing the runner and retrieves the class attribute using the final component of the path.

def get_runner(
settings: object,
test_runner_class: string = null
) - > class

Loads and returns the test runner class specified by the settings or an optional override. This function dynamically imports the module containing the runner and retrieves the class attribute for execution.

Parameters

NameTypeDescription
settingsobjectThe settings object containing the default TEST_RUNNER path string.
test_runner_classstring = nullAn optional dot-separated Python path to a test runner class that overrides the default setting.

Returns

TypeDescription
classThe test runner class retrieved from the specified module path, ready to be instantiated.