summaryrefslogtreecommitdiff
path: root/testing/test_monkeypatch.py
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2016-01-23 19:31:17 +0100
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2016-01-23 19:31:17 +0100
commitb825af2e661a584b1dac1e6c4758d51cf9072657 (patch)
tree8e24b32da422f8d83a8efde1d0fb312d2ac8ecfc /testing/test_monkeypatch.py
parent60e9698530c7cda7d46cd8046ab26b48d22a2aa6 (diff)
downloadpytest-b825af2e661a584b1dac1e6c4758d51cf9072657.tar.gz
pass trough annotated exceptions
Diffstat (limited to 'testing/test_monkeypatch.py')
-rw-r--r--testing/test_monkeypatch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py
index 7270309a9..048c942c8 100644
--- a/testing/test_monkeypatch.py
+++ b/testing/test_monkeypatch.py
@@ -62,11 +62,11 @@ class TestSetattrWithImportPath:
pytest.raises(TypeError, lambda: monkeypatch.setattr(None, None))
def test_unknown_import(self, monkeypatch):
- pytest.raises(pytest.fail.Exception,
+ pytest.raises(ImportError,
lambda: monkeypatch.setattr("unkn123.classx", None))
def test_unknown_attr(self, monkeypatch):
- pytest.raises(pytest.fail.Exception,
+ pytest.raises(AttributeError,
lambda: monkeypatch.setattr("os.path.qweqwe", None))
def test_unknown_attr_non_raising(self, monkeypatch):
@@ -283,7 +283,7 @@ def test_importerror(testdir):
"""))
result = testdir.runpytest()
result.stdout.fnmatch_lines("""
- *import error in package.a.x: No module named {0}doesnotexist{0}*
+ *import error in package.a: No module named {0}doesnotexist{0}*
""".format("'" if sys.version_info > (3, 0) else ""))