5f448c
From acf7c4e073030a69712172b133076101e2b7d81f Mon Sep 17 00:00:00 2001
5f448c
From: Tomas Orsava <torsava@redhat.com>
5f448c
Date: Mon, 12 Dec 2016 12:09:47 +0100
5f448c
Subject: [PATCH] Patch for compatibility with Python 3.6
5f448c
5f448c
Python 3.6 returns a ModuleNotFoundError instead of the previous ImportError.
5f448c
---
5f448c
 functional_tests/test_loader.py           |  2 +-
5f448c
 functional_tests/test_withid_failures.rst | 12 ++++++------
5f448c
 2 files changed, 7 insertions(+), 7 deletions(-)
5f448c
5f448c
diff --git a/functional_tests/test_loader.py b/functional_tests/test_loader.py
5f448c
index 81aaa7b..3f82122 100644
5f448c
--- a/functional_tests/test_loader.py
5f448c
+++ b/functional_tests/test_loader.py
5f448c
@@ -369,7 +369,7 @@ class TestNoseTestLoader(unittest.TestCase):
5f448c
         assert res.errors, "Expected errors but got none"
5f448c
         assert not res.failures, res.failures
5f448c
         err = res.errors[0][0].test.exc_class
5f448c
-        assert err is ImportError, \
5f448c
+        assert issubclass(err, ImportError), \
5f448c
             "Expected import error, got %s" % err
5f448c
 
5f448c
     def test_load_nonsense_name(self):
5f448c
diff --git a/functional_tests/test_withid_failures.rst b/functional_tests/test_withid_failures.rst
5f448c
index cf09d4f..cb20886 100644
5f448c
--- a/functional_tests/test_withid_failures.rst
5f448c
+++ b/functional_tests/test_withid_failures.rst
5f448c
@@ -7,16 +7,16 @@
5f448c
     >>> support = os.path.join(os.path.dirname(__file__), 'support', 'id_fails')
5f448c
     >>> argv = [__file__, '-v', '--with-id', '--id-file', idfile, support]
5f448c
     >>> run(argv=argv, plugins=[TestId()]) # doctest: +ELLIPSIS
5f448c
-    #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
5f448c
+    #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
5f448c
     #2 test_b.test ... ok
5f448c
     #3 test_b.test_fail ... FAIL
5f448c
     <BLANKLINE>
5f448c
     ======================================================================
5f448c
-    ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
5f448c
+    ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
5f448c
     ----------------------------------------------------------------------
5f448c
     Traceback (most recent call last):
5f448c
     ...
5f448c
-    ImportError: No module ...apackagethatdoesntexist...
5f448c
+    ...: No module ...apackagethatdoesntexist...
5f448c
     <BLANKLINE>
5f448c
     ======================================================================
5f448c
     FAIL: test_b.test_fail
5f448c
@@ -35,14 +35,14 @@ Addressing failures works (sometimes).
5f448c
     >>> argv.append('1')
5f448c
     >>> _junk = sys.modules.pop('test_a', None) # 2.3 requires
5f448c
     >>> run(argv=argv, plugins=[TestId()]) #doctest: +ELLIPSIS
5f448c
-    #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
5f448c
+    #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
5f448c
     <BLANKLINE>
5f448c
     ======================================================================
5f448c
-    ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
5f448c
+    ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
5f448c
     ----------------------------------------------------------------------
5f448c
     Traceback (most recent call last):
5f448c
     ...
5f448c
-    ImportError: No module ...apackagethatdoesntexist...
5f448c
+    ...: No module ...apackagethatdoesntexist...
5f448c
     <BLANKLINE>
5f448c
     ----------------------------------------------------------------------
5f448c
     Ran 1 test in ...s
5f448c
-- 
5f448c
2.11.0
5f448c