From 54276d7b378a1fcafec77626b328d8029b9d0dcd Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Mon, 12 Dec 2016 13:51:50 +0100 Subject: [PATCH] Patched to fix compatibility with Python 3.6 --- python-nose-py36.patch | 69 ++++++++++++++++++++++++++++++++++++++++++ python-nose.spec | 10 +++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 python-nose-py36.patch diff --git a/python-nose-py36.patch b/python-nose-py36.patch new file mode 100644 index 0000000..75a47c0 --- /dev/null +++ b/python-nose-py36.patch @@ -0,0 +1,69 @@ +From acf7c4e073030a69712172b133076101e2b7d81f Mon Sep 17 00:00:00 2001 +From: Tomas Orsava +Date: Mon, 12 Dec 2016 12:09:47 +0100 +Subject: [PATCH] Patch for compatibility with Python 3.6 + +Python 3.6 returns a ModuleNotFoundError instead of the previous ImportError. +--- + functional_tests/test_loader.py | 2 +- + functional_tests/test_withid_failures.rst | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/functional_tests/test_loader.py b/functional_tests/test_loader.py +index 81aaa7b..3f82122 100644 +--- a/functional_tests/test_loader.py ++++ b/functional_tests/test_loader.py +@@ -369,7 +369,7 @@ class TestNoseTestLoader(unittest.TestCase): + assert res.errors, "Expected errors but got none" + assert not res.failures, res.failures + err = res.errors[0][0].test.exc_class +- assert err is ImportError, \ ++ assert issubclass(err, ImportError), \ + "Expected import error, got %s" % err + + def test_load_nonsense_name(self): +diff --git a/functional_tests/test_withid_failures.rst b/functional_tests/test_withid_failures.rst +index cf09d4f..cb20886 100644 +--- a/functional_tests/test_withid_failures.rst ++++ b/functional_tests/test_withid_failures.rst +@@ -7,16 +7,16 @@ + >>> support = os.path.join(os.path.dirname(__file__), 'support', 'id_fails') + >>> argv = [__file__, '-v', '--with-id', '--id-file', idfile, support] + >>> run(argv=argv, plugins=[TestId()]) # doctest: +ELLIPSIS +- #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR ++ #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR + #2 test_b.test ... ok + #3 test_b.test_fail ... FAIL + + ====================================================================== +- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...) ++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...) + ---------------------------------------------------------------------- + Traceback (most recent call last): + ... +- ImportError: No module ...apackagethatdoesntexist... ++ ...: No module ...apackagethatdoesntexist... + + ====================================================================== + FAIL: test_b.test_fail +@@ -35,14 +35,14 @@ Addressing failures works (sometimes). + >>> argv.append('1') + >>> _junk = sys.modules.pop('test_a', None) # 2.3 requires + >>> run(argv=argv, plugins=[TestId()]) #doctest: +ELLIPSIS +- #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR ++ #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR + + ====================================================================== +- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...) ++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...) + ---------------------------------------------------------------------- + Traceback (most recent call last): + ... +- ImportError: No module ...apackagethatdoesntexist... ++ ...: No module ...apackagethatdoesntexist... + + ---------------------------------------------------------------------- + Ran 1 test in ...s +-- +2.11.0 + diff --git a/python-nose.spec b/python-nose.spec index c19e5f3..3c49640 100644 --- a/python-nose.spec +++ b/python-nose.spec @@ -33,7 +33,7 @@ output capture and more.\ Name: python-nose Version: 1.3.7 -Release: 11%{?dist} +Release: 12%{?dist} BuildArch: noarch License: LGPLv2+ and Public Domain @@ -52,6 +52,10 @@ Patch1: python-nose-py35.patch Patch2: python-nose-unicode.patch # Allow docutils to read utf-8 source Patch3: python-nose-readunicode.patch +# Fix Python 3.6 compatibility +# Python now returns ModuleNotFoundError instead of the previous ImportError +# https://github.com/nose-devs/nose/pull/1029 +Patch4: python-nose-py36.patch BuildRequires: python2-devel %if 0%{?with_python3} @@ -113,6 +117,7 @@ python3 unit tests. %patch1 -p1 -b .py35 %patch2 -p1 -b .unicode %patch3 -p1 -b .unicode +%patch4 -p1 -b .py36 dos2unix examples/attrib_plugin.py @@ -207,6 +212,9 @@ popd %endif # with_docs %changelog +* Mon Dec 12 2016 Tomas Orsava - 1.3.7-12 +- Patched to fix compatibility with Python 3.6 + * Mon Dec 05 2016 Randy Barlow - 1.3.7-11 - Provide nosetests-3 (#1289820). - Rename python-nose to python2-nose and use Python provides macro.