diff --git a/_pytest/core.py b/_pytest/core.py index 4166ac3c4..cc7726cdf 100644 --- a/_pytest/core.py +++ b/_pytest/core.py @@ -33,7 +33,7 @@ class TagTracer: content = " ".join(map(str, args)) indent = " " * self.indent - + lines = [ "%s%s [%s]\n" %(indent, content, ":".join(tags)) ] @@ -345,7 +345,10 @@ def importplugin(importspec): #if str(e).find(name) == -1: # raise pass # - __import__(importspec) + try: + __import__(importspec) + except ImportError: + raise ImportError(importspec) return sys.modules[importspec] class MultiCall: diff --git a/testing/test_genscript.py b/testing/test_genscript.py index 0ac18015d..39fc18276 100644 --- a/testing/test_genscript.py +++ b/testing/test_genscript.py @@ -3,7 +3,8 @@ import subprocess def pytest_funcarg__standalone(request): - return request.cached_setup(scope="module", setup=lambda: Standalone(request)) + return request.cached_setup(scope="module", + setup=lambda: Standalone(request)) class Standalone: def __init__(self, request): diff --git a/testing/test_runner.py b/testing/test_runner.py index 25e3df28a..984f382e3 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -380,7 +380,7 @@ def test_runtest_in_module_ordering(testdir): def test_outcomeexception_exceptionattributes(): outcome = runner.OutcomeException('test') - assert outcome.message == outcome.msg + assert outcome.args[0] == outcome.msg def test_pytest_exit(): try: