1 |
commit: 198eb85d3a3011c2649d0c48aec38f05a3048506 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 31 14:57:59 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 15:42:26 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=198eb85d |
7 |
|
8 |
dev-python/testtools: Bump to 2.4.0 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/testtools/Manifest | 1 + |
13 |
.../testtools/files/testtools-2.4.0-py39.patch | 76 ++++++++++++++++++++++ |
14 |
dev-python/testtools/testtools-2.4.0.ebuild | 45 +++++++++++++ |
15 |
3 files changed, 122 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/testtools/Manifest b/dev-python/testtools/Manifest |
18 |
index 04cb4cdd6ce..07f0ee86df3 100644 |
19 |
--- a/dev-python/testtools/Manifest |
20 |
+++ b/dev-python/testtools/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST testtools-2.3.0.tar.gz 231559 BLAKE2B 6ae098e368cabc0bfe45736324819687a6086eccf868de7eec312caf7c64b5d75a3168f3966d5cd0b05ad9295957a7aa1ee3c1589f076de1f5cb619b197ba08a SHA512 558fe6a1bdce7215f9f6f178f469a2b76948dc7ff0ce27400482a16683474edb81d9bf90ae48b6fcb8df9eb70759341b694aa162ed3d9d4abd372981cdcd8a64 |
23 |
+DIST testtools-2.4.0.tar.gz 233032 BLAKE2B 8b0559039bfc5e18dfe8d70cc10f6e43ad2e1fbebf7d20d9c6c876c5672a6149064f558150d8eb09f569b82983ffe67e06143b14a1d8869efcc585839d6216ae SHA512 af26e163a4caeb207a554b19f86c7892ab5ebe904c144d85273464e880cd18a991c70a77ff817aefb15768fa38f382e9ed853cdefb212dc697b24072e17535c0 |
24 |
|
25 |
diff --git a/dev-python/testtools/files/testtools-2.4.0-py39.patch b/dev-python/testtools/files/testtools-2.4.0-py39.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..a502e1cc063 |
28 |
--- /dev/null |
29 |
+++ b/dev-python/testtools/files/testtools-2.4.0-py39.patch |
30 |
@@ -0,0 +1,76 @@ |
31 |
+From 1d698cf91cb2205aedc018e465a2e17c5a6a3e94 Mon Sep 17 00:00:00 2001 |
32 |
+From: Michel Alexandre Salim <michel@××××××××××.name> |
33 |
+Date: Sat, 16 May 2020 13:21:38 -0700 |
34 |
+Subject: [PATCH] Fix syntax error test for Python 3.9 |
35 |
+MIME-Version: 1.0 |
36 |
+Content-Type: text/plain; charset=UTF-8 |
37 |
+Content-Transfer-Encoding: 8bit |
38 |
+ |
39 |
+On Python 3.9 the zero-width no-break space Unicode character U+FEFF |
40 |
+does not get printed in syntax errors. |
41 |
+ |
42 |
+See: |
43 |
+https://bugzilla.redhat.com/show_bug.cgi?id=1831126 |
44 |
+ |
45 |
+This is reproducible in a virtual environment as well. |
46 |
+ |
47 |
+Before: |
48 |
+``` |
49 |
+.venv ❯ make check |
50 |
+PYTHONPATH=/home/michel/src/github/testing-cabal/testtools python -m testtools.run testtools.tests.test_suite |
51 |
+/usr/lib64/python3.9/runpy.py:127: RuntimeWarning: 'testtools.run' found in sys.modules after import of package 'testtools', but prior to execution of 'testtools.run'; this may result in unpredictable behaviour |
52 |
+ warn(RuntimeWarning(msg)) |
53 |
+Tests running... |
54 |
+====================================================================== |
55 |
+FAIL: testtools.tests.test_testresult.TestNonAsciiResults.test_syntax_error_line_utf_8 |
56 |
+---------------------------------------------------------------------- |
57 |
+Traceback (most recent call last): |
58 |
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/tests/test_testresult.py", line 2744, in test_syntax_error_line_utf_8 |
59 |
+ self.assertThat( |
60 |
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/testcase.py", line 499, in assertThat |
61 |
+ raise mismatch_error |
62 |
+testtools.matchers._impl.MismatchError: 'Tests running...\n======================================================================\nERROR: test_syntax_error_line_utf_8.Test.runTest\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File "/tmp/TestNonAsciiResultsblblh75h/test_syntax_error_line_utf_8.py", line 6, in runTest\n import bad\n File "/tmp/TestNonAsciiResultsblblh75h/bad.py", line 1\n \ufeff^ = 0 # paɪθən\n ^\nSyntaxError: invalid syntax\n\nRan 1 test in 0.001s\nFAILED (failures=1)\n' does not match /.*bad.py", line 1\n\s*\^ = 0 # pa\u026a\u03b8\u0259n\n \s*\^\nSyntaxError:.*/ |
63 |
+====================================================================== |
64 |
+FAIL: testtools.tests.test_testresult.TestNonAsciiResultsWithUnittest.test_syntax_error_line_utf_8 |
65 |
+---------------------------------------------------------------------- |
66 |
+Traceback (most recent call last): |
67 |
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/tests/test_testresult.py", line 2744, in test_syntax_error_line_utf_8 |
68 |
+ self.assertThat( |
69 |
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/testcase.py", line 499, in assertThat |
70 |
+ raise mismatch_error |
71 |
+testtools.matchers._impl.MismatchError: 'E\n======================================================================\nERROR: runTest (test_syntax_error_line_utf_8.Test)\ntest_syntax_error_line_utf_8.Test.runTest\n----------------------------------------------------------------------\ntesttools.testresult.real._StringException: Traceback (most recent call last):\n File "/tmp/TestNonAsciiResultsWithUnittest_zzswpmj/test_syntax_error_line_utf_8.py", line 6, in runTest\n import bad\n File "/tmp/TestNonAsciiResultsWithUnittest_zzswpmj/bad.py", line 1\n \ufeff^ = 0 # paɪθən\n ^\nSyntaxError: invalid syntax\n\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (errors=1)\n' does not match /.*bad.py", line 1\n\s*\^ = 0 # pa\u026a\u03b8\u0259n\n \s*\^\nSyntaxError:.*/ |
72 |
+ |
73 |
+Ran 2627 tests in 0.569s |
74 |
+FAILED (failures=2) |
75 |
+make: *** [Makefile:7: check] Error 1 |
76 |
+``` |
77 |
+ |
78 |
+After: |
79 |
+``` |
80 |
+.venv ❯ make check |
81 |
+PYTHONPATH=/home/michel/src/github/testing-cabal/testtools python -m testtools.run testtools.tests.test_suite |
82 |
+/usr/lib64/python3.9/runpy.py:127: RuntimeWarning: 'testtools.run' found in sys.modules after import of package 'testtools', but prior to execution of 'testtools.run'; this may result in unpredictable behaviour |
83 |
+ warn(RuntimeWarning(msg)) |
84 |
+Tests running... |
85 |
+ |
86 |
+Ran 2627 tests in 0.492s |
87 |
+OK |
88 |
+``` |
89 |
+--- |
90 |
+ testtools/tests/test_testresult.py | 3 +++ |
91 |
+ 1 file changed, 3 insertions(+) |
92 |
+ |
93 |
+diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py |
94 |
+index 3bbd8937..deceb07d 100644 |
95 |
+--- a/testtools/tests/test_testresult.py |
96 |
++++ b/testtools/tests/test_testresult.py |
97 |
+@@ -2741,6 +2741,9 @@ def test_syntax_error_line_utf_8(self): |
98 |
+ textoutput = self._setup_external_case("import bad") |
99 |
+ self._write_module("bad", "utf-8", "\ufeff^ = 0 # %s\n" % text) |
100 |
+ textoutput = self._run_external_case() |
101 |
++ # Python 3.9 no longer prints the '\ufeff' |
102 |
++ if sys.version_info >= (3,9): |
103 |
++ textoutput = textoutput.replace('\ufeff', '') |
104 |
+ self.assertThat( |
105 |
+ textoutput, |
106 |
+ MatchesRegex( |
107 |
|
108 |
diff --git a/dev-python/testtools/testtools-2.4.0.ebuild b/dev-python/testtools/testtools-2.4.0.ebuild |
109 |
new file mode 100644 |
110 |
index 00000000000..41097304bed |
111 |
--- /dev/null |
112 |
+++ b/dev-python/testtools/testtools-2.4.0.ebuild |
113 |
@@ -0,0 +1,45 @@ |
114 |
+# Copyright 1999-2020 Gentoo Authors |
115 |
+# Distributed under the terms of the GNU General Public License v2 |
116 |
+ |
117 |
+EAPI=7 |
118 |
+ |
119 |
+PYTHON_COMPAT=( python2_7 python3_{6..9} pypy3 ) |
120 |
+PYTHON_REQ_USE="threads(+)" |
121 |
+ |
122 |
+inherit distutils-r1 |
123 |
+ |
124 |
+DESCRIPTION="Extensions to the Python standard library unit testing framework" |
125 |
+HOMEPAGE="https://github.com/testing-cabal/testtools" |
126 |
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" |
127 |
+ |
128 |
+LICENSE="MIT" |
129 |
+SLOT="0" |
130 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
131 |
+ |
132 |
+RDEPEND=" |
133 |
+ >=dev-python/extras-1.0.0[${PYTHON_USEDEP}] |
134 |
+ dev-python/python-mimeparse[${PYTHON_USEDEP}] |
135 |
+ >=dev-python/pbr-0.11[${PYTHON_USEDEP}] |
136 |
+ dev-python/pyrsistent[${PYTHON_USEDEP}] |
137 |
+ >=dev-python/six-1.4.0[${PYTHON_USEDEP}] |
138 |
+ dev-python/traceback2[${PYTHON_USEDEP}] |
139 |
+ >=dev-python/unittest2-1.0.0[${PYTHON_USEDEP}] |
140 |
+" |
141 |
+DEPEND=" |
142 |
+ test? ( |
143 |
+ >=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}] |
144 |
+ dev-python/testscenarios[${PYTHON_USEDEP}] |
145 |
+ ) |
146 |
+" |
147 |
+PDEPEND=">=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}]" |
148 |
+ |
149 |
+PATCHES=( |
150 |
+ "${FILESDIR}"/testtools-2.4.0-py39.patch |
151 |
+) |
152 |
+ |
153 |
+distutils_enable_sphinx doc |
154 |
+distutils_enable_tests unittest |
155 |
+ |
156 |
+python_test() { |
157 |
+ "${PYTHON}" -m testtools.run testtools.tests.test_suite || die "tests failed under ${EPYTHON}" |
158 |
+} |