summaryrefslogtreecommitdiff
path: root/dev-python/testtools/files
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/testtools/files
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/testtools/files')
-rw-r--r--dev-python/testtools/files/testtools-2.3.0-py37.patch44
-rw-r--r--dev-python/testtools/files/testtools-2.4.0-py39.patch76
2 files changed, 120 insertions, 0 deletions
diff --git a/dev-python/testtools/files/testtools-2.3.0-py37.patch b/dev-python/testtools/files/testtools-2.3.0-py37.patch
new file mode 100644
index 000000000000..0f2da043ffe9
--- /dev/null
+++ b/dev-python/testtools/files/testtools-2.3.0-py37.patch
@@ -0,0 +1,44 @@
+https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
+
+From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Thu, 17 May 2018 17:52:26 +0200
+Subject: [PATCH] Fix the tests on Python 3.7
+
+Exception's repr got changed not to include trailing comma
+
+Fixes https://github.com/testing-cabal/testtools/issues/270
+---
+ .travis.yml | 1 +
+ testtools/tests/matchers/test_exception.py | 11 +++++++++--
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
+index 6cd80af1..acd39252 100644
+--- a/testtools/tests/matchers/test_exception.py
++++ b/testtools/tests/matchers/test_exception.py
+@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
+ matches_matches = [error_foo]
+ matches_mismatches = [error_bar, error_base_foo]
+
++ if sys.version_info >= (3, 7):
++ # exception's repr has changed
++ _e = ''
++ else:
++ _e = ','
++
+ str_examples = [
+- ("MatchesException(Exception('foo',))",
++ ("MatchesException(Exception('foo'%s))" % _e,
+ MatchesException(Exception('foo')))
+ ]
+ describe_examples = [
+ ("%r is not a %r" % (Exception, ValueError),
+ error_base_foo,
+ MatchesException(ValueError("foo"))),
+- ("ValueError('bar',) has different arguments to ValueError('foo',).",
++ ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
++ % (_e, _e),
+ error_bar,
+ MatchesException(ValueError("foo"))),
+ ]
diff --git a/dev-python/testtools/files/testtools-2.4.0-py39.patch b/dev-python/testtools/files/testtools-2.4.0-py39.patch
new file mode 100644
index 000000000000..a502e1cc0630
--- /dev/null
+++ b/dev-python/testtools/files/testtools-2.4.0-py39.patch
@@ -0,0 +1,76 @@
+From 1d698cf91cb2205aedc018e465a2e17c5a6a3e94 Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <michel@michel-slm.name>
+Date: Sat, 16 May 2020 13:21:38 -0700
+Subject: [PATCH] Fix syntax error test for Python 3.9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On Python 3.9 the zero-width no-break space Unicode character U+FEFF
+does not get printed in syntax errors.
+
+See:
+https://bugzilla.redhat.com/show_bug.cgi?id=1831126
+
+This is reproducible in a virtual environment as well.
+
+Before:
+```
+.venv ❯ make check
+PYTHONPATH=/home/michel/src/github/testing-cabal/testtools python -m testtools.run testtools.tests.test_suite
+/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
+ warn(RuntimeWarning(msg))
+Tests running...
+======================================================================
+FAIL: testtools.tests.test_testresult.TestNonAsciiResults.test_syntax_error_line_utf_8
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/tests/test_testresult.py", line 2744, in test_syntax_error_line_utf_8
+ self.assertThat(
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/testcase.py", line 499, in assertThat
+ raise mismatch_error
+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:.*/
+======================================================================
+FAIL: testtools.tests.test_testresult.TestNonAsciiResultsWithUnittest.test_syntax_error_line_utf_8
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/tests/test_testresult.py", line 2744, in test_syntax_error_line_utf_8
+ self.assertThat(
+ File "/home/michel/src/github/testing-cabal/testtools/testtools/testcase.py", line 499, in assertThat
+ raise mismatch_error
+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:.*/
+
+Ran 2627 tests in 0.569s
+FAILED (failures=2)
+make: *** [Makefile:7: check] Error 1
+```
+
+After:
+```
+.venv ❯ make check
+PYTHONPATH=/home/michel/src/github/testing-cabal/testtools python -m testtools.run testtools.tests.test_suite
+/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
+ warn(RuntimeWarning(msg))
+Tests running...
+
+Ran 2627 tests in 0.492s
+OK
+```
+---
+ testtools/tests/test_testresult.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py
+index 3bbd8937..deceb07d 100644
+--- a/testtools/tests/test_testresult.py
++++ b/testtools/tests/test_testresult.py
+@@ -2741,6 +2741,9 @@ def test_syntax_error_line_utf_8(self):
+ textoutput = self._setup_external_case("import bad")
+ self._write_module("bad", "utf-8", "\ufeff^ = 0 # %s\n" % text)
+ textoutput = self._run_external_case()
++ # Python 3.9 no longer prints the '\ufeff'
++ if sys.version_info >= (3,9):
++ textoutput = textoutput.replace('\ufeff', '')
+ self.assertThat(
+ textoutput,
+ MatchesRegex(