Sometimes Python Eggs are marked as zip-safe and they can be installed zipped, instead of unzipped in a .egg folder. See http://peak.telecommunity.com/DevCenter/PythonEggs for more details. The normal nose2.plugins.loader.discovery plugin ignores modules located inside zip files.
The Egg Discovery plugin allows nose2 to discover tests within these zipped egg files.
This plugin requires pkg_resources (from setuptools) to work correctly.
To activate the plugin, include the plugin module in the plugins list in [unittest] section in a config file:
[unittest]
plugins = nose2.plugins.loader.eggdiscovery
Or pass the module with the --plugin command-line option:
nose2 --plugin=nose2.plugins.loader.eggdiscovery module_in_egg
Egg-based discovery test loader.
This plugin implements nose2’s automatic test module discovery inside Egg Files. It looks for test modules in packages 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.
Default: | True |
---|---|
Type: | boolean |
The default configuration is equivalent to including the following in a unittest.cfg file.
[discovery]
always-on = True