Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_plugin_instance():
return HTMLReporter(session=Session())
def _get_objects(self):
ssn = session.Session()
ldr = loader.PluggableTestLoader(ssn)
rnr = runner.PluggableTestRunner(ssn)
return ssn, ldr, rnr
The class to instantiate to create a test runner. Default:
:class:`nose2.runner.PluggableTestRunner`.
.. warning ::
Overriding this attribute is the only way to customize
the test runner class. Passing a test runner to
:func:`__init__` does not work.
.. attribute :: defaultPlugins
List of default plugin modules to load.
"""
sessionClass = session.Session
_currentSession = None
loaderClass = loader.PluggableTestLoader
runnerClass = runner.PluggableTestRunner
defaultPlugins = plugins.DEFAULT_PLUGINS
excludePlugins = ()
# XXX override __init__ to warn that testLoader and testRunner are ignored?
def __init__(self, **kw):
plugins = kw.pop('plugins', [])
exclude = kw.pop('excludePlugins', [])
hooks = kw.pop('extraHooks', [])
self.defaultPlugins = list(self.defaultPlugins)
self.excludePlugins = list(self.excludePlugins)
self.extraHooks = hooks
self.defaultPlugins.extend(plugins)
self.excludePlugins.extend(exclude)
def import_session(rlog, session_export):
ssn = session.Session()
ssn.config = session_export['config']
ssn.hooks = RecordingPluginInterface()
ssn.verbosity = session_export['verbosity']
ssn.startDir = session_export['startDir']
ssn.topLevelDir = session_export['topLevelDir']
ssn.prepareSysPath()
loader_ = loader.PluggableTestLoader(ssn)
ssn.testLoader = loader_
result_ = result.PluggableTestResult(ssn)
ssn.testResult = result_
runner_ = runner.PluggableTestRunner(ssn) # needed??
ssn.testRunner = runner_
# load and register plugins, forcing multiprocess to the end
ssn.plugins = [
plugin(session=ssn) for plugin in session_export['pluginClasses']
if plugin is not MultiProcess