diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 20:18:26 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 20:18:26 +0100 |
commit | 6c30cc2d5bd48ddbdbe8d75544899cd5dbfcaba4 (patch) | |
tree | 6ef7f6e1d48141a5da904d788b906da5bba4b697 /dev-python/testtools/files | |
parent | 62f82c107c3904ac6917ece47301d2999c7dd90e (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/testtools/files')
4 files changed, 44 insertions, 164 deletions
diff --git a/dev-python/testtools/files/testtools-1.8.0-twisted-backport.patch b/dev-python/testtools/files/testtools-1.8.0-twisted-backport.patch deleted file mode 100644 index fd65b4cd6f53..000000000000 --- a/dev-python/testtools/files/testtools-1.8.0-twisted-backport.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 25f4800d62f339f81b09c894275a3af4b284fb62 Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@canonical.com> -Date: Wed, 19 Aug 2015 03:06:09 +0100 -Subject: [PATCH] Port twisted.deferredruntest to Twisted >= 15.1.0 - -Twisted 15.1.0 removes the compatibility import of _LogObserver in -twisted.trial.unittest. This is unfortunate for us, but it's what we -get for using an internal interface. It at least still exists in -twisted.trial._synctest, so we can get it from there. - -Twisted 15.2.0 adds the new twisted.logger framework, which requires a -slight adjustment to run_with_log_observers. There's no longer a -supported interface to get hold of all log observers, but since we're -already using an internal interface (see above), what's one more? - -This passes "make check" with the current release, Twisted 15.3.0. ---- - testtools/deferredruntest.py | 27 +++++++++++++++++++++++---- - 1 file changed, 23 insertions(+), 4 deletions(-) - -diff --git a/testtools/deferredruntest.py b/testtools/deferredruntest.py -index c33e14a..04cdb0f 100644 ---- a/testtools/deferredruntest.py -+++ b/testtools/deferredruntest.py -@@ -27,8 +27,15 @@ - ) - - from twisted.internet import defer -+try: -+ from twisted.logger import globalLogPublisher -+except ImportError: -+ globalLogPublisher = None - from twisted.python import log --from twisted.trial.unittest import _LogObserver -+try: -+ from twisted.trial.unittest import _LogObserver -+except ImportError: -+ from twisted.trial._synctest import _LogObserver - - - class _DeferredRunTest(RunTest): -@@ -53,9 +60,21 @@ def _run_user(self, function, *args): - - def run_with_log_observers(observers, function, *args, **kwargs): - """Run 'function' with the given Twisted log observers.""" -- real_observers = list(log.theLogPublisher.observers) -+ if globalLogPublisher is not None: -+ # Twisted >= 15.2.0, with the new twisted.logger framework. -+ # log.theLogPublisher.observers will only contain legacy observers; -+ # we need to look at globalLogPublisher._observers, which contains -+ # both legacy and modern observers, and add and remove them via -+ # globalLogPublisher. However, we must still add and remove the -+ # observers we want to run with via log.theLogPublisher, because -+ # _LogObserver may consider old keys and require them to be mapped. -+ publisher = globalLogPublisher -+ real_observers = list(publisher._observers) -+ else: -+ publisher = log.theLogPublisher -+ real_observers = list(publisher.observers) - for observer in real_observers: -- log.theLogPublisher.removeObserver(observer) -+ publisher.removeObserver(observer) - for observer in observers: - log.theLogPublisher.addObserver(observer) - try: -@@ -64,7 +83,7 @@ def run_with_log_observers(observers, function, *args, **kwargs): - for observer in observers: - log.theLogPublisher.removeObserver(observer) - for observer in real_observers: -- log.theLogPublisher.addObserver(observer) -+ publisher.addObserver(observer) - - - # Observer of the Twisted log that we install during tests. diff --git a/dev-python/testtools/files/testtools-1.8.0-twisted-backport1.patch b/dev-python/testtools/files/testtools-1.8.0-twisted-backport1.patch deleted file mode 100644 index c1eb11b1f5ab..000000000000 --- a/dev-python/testtools/files/testtools-1.8.0-twisted-backport1.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 6d821b5770b01f5ec98c3b8db734fffeebf12b62 Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@canonical.com> -Date: Mon, 24 Aug 2015 13:21:57 +0100 -Subject: [PATCH] Test with Twisted 13.0.0/15.2.0. - ---- - .travis.yml | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/.travis.yml b/.travis.yml -index 41036f8..a706b27 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -7,6 +7,10 @@ python: - - "3.4" - - "pypy" - -+env: -+ - TWISTED="==13.0.0" -+ - TWISTED="==15.2.0" -+ - # We have to pin Jinja2 < 2.7 for Python 3.2 because 2.7 drops/breaks support: - # http://jinja.pocoo.org/docs/changelog/#version-2-7 - # And Spinx to < 1.3 for pypy3 and python 3.2 similarly. -@@ -23,7 +27,7 @@ matrix: - env: SPHINX="<1.3" - - install: -- - pip install fixtures $JINJA_REQ sphinx$SPHINX -+ - pip install fixtures $JINJA_REQ sphinx$SPHINX Twisted$TWISTED - - python setup.py install - - script: diff --git a/dev-python/testtools/files/testtools-1.8.0-twisted-backport2.patch b/dev-python/testtools/files/testtools-1.8.0-twisted-backport2.patch deleted file mode 100644 index df5d91f9b681..000000000000 --- a/dev-python/testtools/files/testtools-1.8.0-twisted-backport2.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 2e03ffaff15bc5d83c5f6d092aab4072f166aca0 Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@canonical.com> -Date: Mon, 24 Aug 2015 13:45:01 +0100 -Subject: [PATCH] Only run Twisted tests on Python 2. - ---- - .travis.yml | 22 ++++++++++++++++------ - 1 file changed, 16 insertions(+), 6 deletions(-) - -diff --git a/.travis.yml b/.travis.yml -index a706b27..bc007f2 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -7,27 +7,37 @@ python: - - "3.4" - - "pypy" - --env: -- - TWISTED="==13.0.0" -- - TWISTED="==15.2.0" -- - # We have to pin Jinja2 < 2.7 for Python 3.2 because 2.7 drops/breaks support: - # http://jinja.pocoo.org/docs/changelog/#version-2-7 --# And Spinx to < 1.3 for pypy3 and python 3.2 similarly. -+# And Sphinx to < 1.3 for pypy3 and python 3.2 similarly. - # - # See also: - # http://stackoverflow.com/questions/18252804/syntax-error-in-jinja-2-library -+# -+# Twisted tests currently only work on Python 2. - matrix: - include: -+ - python: "2.6" -+ env: -+ - TWISTED_REQ="Twisted==13.0.0" -+ - TWISTED_REQ="Twisted==15.2.0" -+ - python: "2.7" -+ env: -+ - TWISTED_REQ="Twisted==13.0.0" -+ - TWISTED_REQ="Twisted==15.2.0" - - python: "3.2" - env: - - JINJA_REQ="jinja2<2.7, Pygments<2.0" - - SPHINX="<1.3" -+ - python: "pypy" -+ env: -+ - TWISTED_REQ="Twisted==13.0.0" -+ - TWISTED_REQ="Twisted==15.2.0" - - python: "pypy3" - env: SPHINX="<1.3" - - install: -- - pip install fixtures $JINJA_REQ sphinx$SPHINX Twisted$TWISTED -+ - pip install fixtures $JINJA_REQ sphinx$SPHINX $TWISTED_REQ - - python setup.py install - - script: 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"))), + ] |