guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: python-testtools: Fix regression in test suite.


From: Efraim Flashner
Subject: 01/01: gnu: python-testtools: Fix regression in test suite.
Date: Thu, 11 Oct 2018 15:37:39 -0400 (EDT)

efraim pushed a commit to branch core-updates
in repository guix.

commit 0ea6af996b06ba453b803f2d4b014ffa709db4b7
Author: Efraim Flashner <address@hidden>
Date:   Thu Oct 11 22:33:59 2018 +0300

    gnu: python-testtools: Fix regression in test suite.
    
    * gnu/packages/check.scm (python-testtools)[source]: Add patch.
    * gnu/packages/patches/python-testtools.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                |  1 +
 gnu/packages/check.scm                      |  3 +-
 gnu/packages/patches/python-testtools.patch | 57 +++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 15c8159..e5745ba 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1087,6 +1087,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-configobj-setuptools.patch       \
   %D%/packages/patches/python-faker-fix-build-32bit.patch      \
   %D%/packages/patches/python-mox3-python3.6-compat.patch      \
+  %D%/packages/patches/python-testtools.patch                  \
   %D%/packages/patches/python-paste-remove-website-test.patch  \
   %D%/packages/patches/python-paste-remove-timing-test.patch   \
   %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch     \
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 2868f72..1ae6355 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -879,7 +879,8 @@ subprocess and see the output as well as any file 
modifications.")
        (uri (pypi-uri "testtools" version))
        (sha256
         (base32
-         "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))))
+         "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
+       (patches (search-patches "python-testtools.patch"))))
     (build-system python-build-system)
     (arguments '(#:tests? #f))
     (propagated-inputs
diff --git a/gnu/packages/patches/python-testtools.patch 
b/gnu/packages/patches/python-testtools.patch
new file mode 100644
index 0000000..42536e5
--- /dev/null
+++ b/gnu/packages/patches/python-testtools.patch
@@ -0,0 +1,57 @@
+https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
+Should be fixed in the next release
+
+From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <address@hidden>
+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"))),
+         ]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]