Skip to content

Commit 00f8f52

Browse files
committed
Use ImportError in Python 3.5
1 parent b1caefe commit 00f8f52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testing/test_collection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1423,9 +1423,10 @@ def test_modules_not_importable_as_side_effect(self, testdir):
14231423
"""
14241424
self.setup_conftest_and_foo(testdir)
14251425
result = testdir.runpytest("-v", "--import-mode=importlib")
1426+
exc_name = "ModuleNotFoundError" if sys.version_info > (3, 5) else "ImportError"
14261427
result.stdout.fnmatch_lines(
14271428
[
1428-
"*ModuleNotFoundError: No module named 'foo'",
1429+
"*{}: No module named 'foo'".format(exc_name),
14291430
"tests?test_foo.py:2: ModuleNotFoundError",
14301431
"* 1 failed in *",
14311432
]

0 commit comments

Comments
 (0)