simplify exception capturing
--HG-- branch : plugin_no_pytest
This commit is contained in:
parent
c08dfdc330
commit
20d6c0b560
|
@ -207,14 +207,11 @@ class PytestPluginManager(PluginManager):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
mod = importplugin(modname)
|
mod = importplugin(modname)
|
||||||
except KeyboardInterrupt:
|
|
||||||
raise
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if modname.startswith("pytest_"):
|
if modname.startswith("pytest_"):
|
||||||
return self.import_plugin(modname[7:])
|
return self.import_plugin(modname[7:])
|
||||||
raise
|
raise
|
||||||
except:
|
except Exception as e:
|
||||||
e = sys.exc_info()[1]
|
|
||||||
import pytest
|
import pytest
|
||||||
if not hasattr(pytest, 'skip') or not isinstance(e, pytest.skip.Exception):
|
if not hasattr(pytest, 'skip') or not isinstance(e, pytest.skip.Exception):
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue