fixed PY-10991 pytestrunner fails with TypeError

This commit is contained in:
Ekaterina Tuzova
2013-10-02 12:51:51 +04:00
parent 963f53c27a
commit be7a549a1d
+9 -2
View File
@@ -12,12 +12,19 @@ except:
except:
raise NameError("No py.test runner found in selected interpreter")
def get_plugin_manager():
try:
from _pytest.config import get_plugin_manager
return get_plugin_manager()
except ImportError:
from _pytest.core import PluginManager
return PluginManager(load=True)
if has_pytest:
_preinit = []
from _pytest.core import PluginManager
def main():
args = sys.argv[1:]
_pluginmanager = PluginManager(load=True)
_pluginmanager = get_plugin_manager()
hook = _pluginmanager.hook
try:
config = hook.pytest_cmdline_parse(