Loader: Test discovery

Discovery-based test loader.

This plugin implements nose2’s automatic test module discovery. It looks for test modules in packages and directories whose names start with test, then fires the loadTestsFromModule() hook for each one to allow other plugins to load the actual tests.

It also fires handleFile() for every file that it sees, and matchPath() for every Python module, to allow other plugins to load tests from other kinds of files and to influence which modules are examined for tests.

Configuration [discovery]


Sample configuration

The default configuration is equivalent to including the following in a unittest.cfg file.

always-on = True

Plugin class reference: DiscoveryLoader

class nose2.plugins.loader.discovery.DiscoveryLoader[source]

Loader plugin that can discover tests


Load tests from module named by event.name


Discover tests if no test names specified