aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-nose/python3.6-compat.patch
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-03-16 02:48:47 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-04-02 01:43:47 +0000
commitaad2afe051973fa7fd6f4f9b83703c09445ff17c (patch)
tree4266144bb0c3984f784b0dd910d33fa98a72c353 /community/py3-nose/python3.6-compat.patch
parentaad758e364da9a69d0d519b619cc6eb2c7d150f8 (diff)
downloadaports-aad2afe051973fa7fd6f4f9b83703c09445ff17c.tar.bz2
aports-aad2afe051973fa7fd6f4f9b83703c09445ff17c.tar.xz
community/py3-*: move from main/ and modernize
Diffstat (limited to 'community/py3-nose/python3.6-compat.patch')
-rw-r--r--community/py3-nose/python3.6-compat.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/community/py3-nose/python3.6-compat.patch b/community/py3-nose/python3.6-compat.patch
new file mode 100644
index 0000000000..e6831bce80
--- /dev/null
+++ b/community/py3-nose/python3.6-compat.patch
@@ -0,0 +1,61 @@
+From: Tomas Orsava <torsava@redhat.com>
+Date: Mon, 12 Dec 2016 14:35:50 +0100
+Subject: [PATCH] Fix compatibility with Python 3.6
+
+Python 3.6 returns ModuleNotFoundError instead of the previous ImportError.
+
+Patch-Source: https://github.com/nose-devs/nose/pull/1029
+
+index 104f2209..906e2ba2 100644
+--- a/functional_tests/test_loader.py
++++ b/functional_tests/test_loader.py
+@@ -372,7 +372,7 @@ def test_failed_import_module_name(self):
+ 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):
+index cf09d4fb..cb20886b 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
+ <BLANKLINE>
+ ======================================================================
+- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
+ ----------------------------------------------------------------------
+ Traceback (most recent call last):
+ ...
+- ImportError: No module ...apackagethatdoesntexist...
++ ...: No module ...apackagethatdoesntexist...
+ <BLANKLINE>
+ ======================================================================
+ 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
+ <BLANKLINE>
+ ======================================================================
+- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
+ ----------------------------------------------------------------------
+ Traceback (most recent call last):
+ ...
+- ImportError: No module ...apackagethatdoesntexist...
++ ...: No module ...apackagethatdoesntexist...
+ <BLANKLINE>
+ ----------------------------------------------------------------------
+ Ran 1 test in ...s