Exemple #1
0
 def test_consider_env_plugin_instantiation(self, testdir, monkeypatch):
     pluginmanager = PluginManager()
     testdir.syspathinsert()
     testdir.makepyfile(xy123="#")
     monkeypatch.setitem(os.environ, 'PYTEST_PLUGINS', 'xy123')
     l1 = len(pluginmanager.getplugins())
     pluginmanager.consider_env()
     l2 = len(pluginmanager.getplugins())
     assert l2 == l1 + 1
     assert pluginmanager.getplugin('xy123')
     pluginmanager.consider_env()
     l3 = len(pluginmanager.getplugins())
     assert l2 == l3
Exemple #2
0
 def test_consider_env_plugin_instantiation(self, testdir, monkeypatch):
     pluginmanager = PluginManager()
     testdir.syspathinsert()
     testdir.makepyfile(xy123="#")
     monkeypatch.setitem(os.environ, 'PYTEST_PLUGINS', 'xy123')
     l1 = len(pluginmanager.getplugins())
     pluginmanager.consider_env()
     l2 = len(pluginmanager.getplugins())
     assert l2 == l1 + 1
     assert pluginmanager.getplugin('xy123')
     pluginmanager.consider_env()
     l3 = len(pluginmanager.getplugins())
     assert l2 == l3