1 https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
2 Should be fixed in the next release
4 From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
5 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
6 Date: Thu, 17 May 2018 17:52:26 +0200
7 Subject: [PATCH] Fix the tests on Python 3.7
9 Exception's repr got changed not to include trailing comma
11 Fixes https://github.com/testing-cabal/testtools/issues/270
14 testtools/tests/matchers/test_exception.py | 11 +++++++++--
15 2 files changed, 10 insertions(+), 2 deletions(-)
17 diff --git a/.travis.yml b/.travis.yml
18 index 7f1f4db7..784608e0 100644
21 @@ -5,6 +5,7 @@ python:
29 diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
30 index 6cd80af1..acd39252 100644
31 --- a/testtools/tests/matchers/test_exception.py
32 +++ b/testtools/tests/matchers/test_exception.py
33 @@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
34 matches_matches = [error_foo]
35 matches_mismatches = [error_bar, error_base_foo]
37 + if sys.version_info >= (3, 7):
38 + # exception's repr has changed
44 - ("MatchesException(Exception('foo',))",
45 + ("MatchesException(Exception('foo'%s))" % _e,
46 MatchesException(Exception('foo')))
49 ("%r is not a %r" % (Exception, ValueError),
51 MatchesException(ValueError("foo"))),
52 - ("ValueError('bar',) has different arguments to ValueError('foo',).",
53 + ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
56 MatchesException(ValueError("foo"))),