[packages/python-testtools/py3-without-backports] - added py37 patch (adjust exception repr)
qboosh
qboosh at pld-linux.org
Fri Jan 10 19:47:25 CET 2020
commit 1c2e6c740b63f2fd7ef1db2ed24badb2be9385e8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Jan 10 19:47:20 2020 +0100
- added py37 patch (adjust exception repr)
python-testtools-py37.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++
python-testtools.spec | 3 +++
2 files changed, 57 insertions(+)
---
diff --git a/python-testtools.spec b/python-testtools.spec
index fb350f2..0391201 100644
--- a/python-testtools.spec
+++ b/python-testtools.spec
@@ -17,6 +17,8 @@ Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{
# Source0-md5: 0f0feb915497816cb99e39437494217e
Patch0: %{name}-tests-nosource.patch
Patch1: %{name}-deps.patch
+# https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
+Patch2: %{name}-py37.patch
URL: https://github.com/testing-cabal/testtools
%if %{with python2}
BuildRequires: python-devel >= 1:2.7
@@ -96,6 +98,7 @@ Dokumentacja HTML do pakietu Pythona testttools.
%setup -q -n testtools-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
%if %{with python2}
diff --git a/python-testtools-py37.patch b/python-testtools-py37.patch
new file mode 100644
index 0000000..2241c83
--- /dev/null
+++ b/python-testtools-py37.patch
@@ -0,0 +1,54 @@
+From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at 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/.travis.yml b/.travis.yml
+index 7f1f4db7..784608e0 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -5,6 +5,7 @@ python:
+ - "3.4"
+ - "3.5"
+ - "3.6"
++ - "3.7-dev"
+ - "pypy"
+
+ install:
+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"))),
+ ]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-testtools.git/commitdiff/1c2e6c740b63f2fd7ef1db2ed24badb2be9385e8
More information about the pld-cvs-commit
mailing list