Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/nose/, dev-python/nose/files/
Date: Tue, 28 Mar 2017 22:30:47
Message-Id: 1490740241.36631728b23c15e9fdc2db85808ab4eb520dd6a3.zmedico@gentoo
1 commit: 36631728b23c15e9fdc2db85808ab4eb520dd6a3
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 28 22:22:37 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 28 22:30:41 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36631728
7
8 dev-python/nose: fix tests for python3.6 (bug 613534)
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 .../nose/files/nose-1.3.7-python-3.6-test.patch | 67 ++++++++++++++++++++++
13 dev-python/nose/nose-1.3.7-r3.ebuild | 2 +
14 2 files changed, 69 insertions(+)
15
16 diff --git a/dev-python/nose/files/nose-1.3.7-python-3.6-test.patch b/dev-python/nose/files/nose-1.3.7-python-3.6-test.patch
17 new file mode 100644
18 index 00000000000..eda10ff036c
19 --- /dev/null
20 +++ b/dev-python/nose/files/nose-1.3.7-python-3.6-test.patch
21 @@ -0,0 +1,67 @@
22 +From 84bb82245d10798825439dc13846eb0538d84239 Mon Sep 17 00:00:00 2001
23 +From: Tomas Orsava <torsava@××××××.com>
24 +Date: Mon, 12 Dec 2016 14:35:50 +0100
25 +Subject: [PATCH] Fix compatibility with Python 3.6
26 +
27 +Python 3.6 returns ModuleNotFoundError instead of the previous ImportError.
28 +https://github.com/nose-devs/nose/pull/1029
29 +---
30 + functional_tests/test_loader.py | 2 +-
31 + functional_tests/test_withid_failures.rst | 12 ++++++------
32 + 2 files changed, 7 insertions(+), 7 deletions(-)
33 +
34 +diff --git a/functional_tests/test_loader.py b/functional_tests/test_loader.py
35 +index 104f220..906e2ba 100644
36 +--- a/functional_tests/test_loader.py
37 ++++ b/functional_tests/test_loader.py
38 +@@ -372,7 +372,7 @@ def test_failed_import_module_name(self):
39 + assert res.errors, "Expected errors but got none"
40 + assert not res.failures, res.failures
41 + err = res.errors[0][0].test.exc_class
42 +- assert err is ImportError, \
43 ++ assert issubclass(err, ImportError), \
44 + "Expected import error, got %s" % err
45 +
46 + def test_load_nonsense_name(self):
47 +diff --git a/functional_tests/test_withid_failures.rst b/functional_tests/test_withid_failures.rst
48 +index cf09d4f..cb20886 100644
49 +--- a/functional_tests/test_withid_failures.rst
50 ++++ b/functional_tests/test_withid_failures.rst
51 +@@ -7,16 +7,16 @@
52 + >>> support = os.path.join(os.path.dirname(__file__), 'support', 'id_fails')
53 + >>> argv = [__file__, '-v', '--with-id', '--id-file', idfile, support]
54 + >>> run(argv=argv, plugins=[TestId()]) # doctest: +ELLIPSIS
55 +- #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
56 ++ #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
57 + #2 test_b.test ... ok
58 + #3 test_b.test_fail ... FAIL
59 + <BLANKLINE>
60 + ======================================================================
61 +- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
62 ++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
63 + ----------------------------------------------------------------------
64 + Traceback (most recent call last):
65 + ...
66 +- ImportError: No module ...apackagethatdoesntexist...
67 ++ ...: No module ...apackagethatdoesntexist...
68 + <BLANKLINE>
69 + ======================================================================
70 + FAIL: test_b.test_fail
71 +@@ -35,14 +35,14 @@ Addressing failures works (sometimes).
72 + >>> argv.append('1')
73 + >>> _junk = sys.modules.pop('test_a', None) # 2.3 requires
74 + >>> run(argv=argv, plugins=[TestId()]) #doctest: +ELLIPSIS
75 +- #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
76 ++ #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
77 + <BLANKLINE>
78 + ======================================================================
79 +- ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
80 ++ ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
81 + ----------------------------------------------------------------------
82 + Traceback (most recent call last):
83 + ...
84 +- ImportError: No module ...apackagethatdoesntexist...
85 ++ ...: No module ...apackagethatdoesntexist...
86 + <BLANKLINE>
87 + ----------------------------------------------------------------------
88 + Ran 1 test in ...s
89
90 diff --git a/dev-python/nose/nose-1.3.7-r3.ebuild b/dev-python/nose/nose-1.3.7-r3.ebuild
91 index ea7cb29cdbd..e58e73ded7d 100644
92 --- a/dev-python/nose/nose-1.3.7-r3.ebuild
93 +++ b/dev-python/nose/nose-1.3.7-r3.ebuild
94 @@ -37,6 +37,8 @@ PATCHES=(
95 # Patch against master found in an upstream PR, backported:
96 # https://github.com/nose-devs/nose/pull/1004
97 "${FILESDIR}"/${P}-coverage-4.1-support.patch
98 +
99 + "${FILESDIR}"/${P}-python-3.6-test.patch
100 )
101
102 pkg_setup() {