Package: python-testtools / 2.3.0-5

Fix_the_tests_on_Python_3.7.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Author: Miro HronĨok <miro@hroncok.cz>
Date: Thu, 17 May 2018 17:52:26 +0200
Description: 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
Origin: upstream, https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f
Last-Update: 2018-09-07

Index: python-testtools/.travis.yml
===================================================================
--- python-testtools.orig/.travis.yml
+++ python-testtools/.travis.yml
@@ -6,6 +6,7 @@ python:
   - "3.4"
   - "3.5"
   - "3.6"
+  - "3.7-dev"
   - "pypy"
 
 install:
Index: python-testtools/testtools/tests/matchers/test_exception.py
===================================================================
--- python-testtools.orig/testtools/tests/matchers/test_exception.py
+++ python-testtools/testtools/tests/matchers/test_exception.py
@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterf
     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"))),
         ]