Hello community,
here is the log from the commit of package python-testtools for
openSUSE:Factory checked in at 2017-07-11 08:24:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-testtools (Old)
and /work/SRC/openSUSE:Factory/.python-testtools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-testtools"
Tue Jul 11 08:24:56 2017 rev:21 rq:507964 version:2.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-testtools/python-testtools-doc.changes
2017-05-06 18:26:59.133797562 +0200
+++
/work/SRC/openSUSE:Factory/.python-testtools.new/python-testtools-doc.changes
2017-07-11 08:24:57.530950005 +0200
@@ -1,0 +2,13 @@
+Tue Jul 4 04:07:32 UTC 2017 - [email protected]
+
+- update to 2.3.0:
+ * Release 2.3.0
+ * Add ResourcedToStreamDecorator test result decorator for testresources
integration (#243)
+ * Make KeysEqual usable with no arguments, i.e. match a dict with no keys.
(#241)
+ * Add testtools.assertions to the documented API modules (#257)
+ * Add Python 3.6 to the list of Travis targets (#255)
+ * Don't add file details without content (#252)
+ * Don't run Sphinx on Travis Python 3.3 target (#250)
+ * Make twistedsupport and tests work on Python 3
+
+-------------------------------------------------------------------
python-testtools.changes: same change
Old:
----
testtools-2.2.0.tar.gz
New:
----
testtools-2.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-testtools-doc.spec ++++++
--- /var/tmp/diff_new_pack.i0kKrX/_old 2017-07-11 08:24:58.322838315 +0200
+++ /var/tmp/diff_new_pack.i0kKrX/_new 2017-07-11 08:24:58.326837751 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-testtools-doc
-Version: 2.2.0
+Version: 2.3.0
Release: 0
Summary: Documentation for python-testtools
License: MIT
python-testtools.spec: same change
++++++ testtools-2.2.0.tar.gz -> testtools-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/.travis.yml
new/testtools-2.3.0/.travis.yml
--- old/testtools-2.2.0/.travis.yml 2016-02-29 00:17:04.000000000 +0100
+++ new/testtools-2.3.0/.travis.yml 2017-02-22 18:00:11.000000000 +0100
@@ -5,25 +5,16 @@
- "3.3"
- "3.4"
- "3.5"
+ - "3.6"
- "pypy"
-# Twisted tests currently only work on Python 2.
-matrix:
- include:
- - python: "2.7"
- env: TWISTED_REQ="Twisted==13.0.0"
- - python: "2.7"
- env: TWISTED_REQ="Twisted"
- - python: "pypy"
- env: TWISTED_REQ="Twisted==13.0.0"
- - python: "pypy"
- env: TWISTED_REQ="Twisted"
-
install:
- pip install -U pip wheel setuptools
- - pip install sphinx $TWISTED_REQ
+ - pip install sphinx Twisted
- pip install .[test]
script:
- python -m testtools.run testtools.tests.test_suite
+ # Sphinx only supports 2.7 or >= 3.4
+ - if [ ${TRAVIS_PYTHON_VERSION} = "3.3" ]; then travis_terminate 0; fi
- make clean-sphinx docs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/AUTHORS new/testtools-2.3.0/AUTHORS
--- old/testtools-2.2.0/AUTHORS 2016-05-19 01:42:20.000000000 +0200
+++ new/testtools-2.3.0/AUTHORS 2017-05-11 15:48:49.000000000 +0200
@@ -15,7 +15,11 @@
Daniel Watkins <[email protected]>
Elliot Murphy <[email protected]>
Elliot Murphy <[email protected]>
+Free Ekanayaka <[email protected]>
+Free Ekanayaka <[email protected]>
+Free Ekanayaka <[email protected]>
Gavin Panella <[email protected]>
+Gavin Panella <[email protected]>
Graham Binns <[email protected]>
James Westby <[email protected]>
Jamu Kakar <[email protected]>
@@ -42,6 +46,7 @@
Robert Collins <[email protected]>
Thomas Bechtold <[email protected]>
Thomas Herve <[email protected]>
+Thomas Hervé <[email protected]>
Thomi Richards <[email protected]>
Thomi Richards <[email protected]>
Tres Seaver <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/ChangeLog
new/testtools-2.3.0/ChangeLog
--- old/testtools-2.2.0/ChangeLog 2016-05-19 01:42:20.000000000 +0200
+++ new/testtools-2.3.0/ChangeLog 2017-05-11 15:48:49.000000000 +0200
@@ -1,6 +1,18 @@
CHANGES
=======
+2.3.0
+-----
+
+* Release 2.3.0
+* Add ResourcedToStreamDecorator test result decorator for testresources
integration (#243)
+* Make KeysEqual usable with no arguments, i.e. match a dict with no keys.
(#241)
+* Add testtools.assertions to the documented API modules (#257)
+* Add Python 3.6 to the list of Travis targets (#255)
+* Don't add file details without content (#252)
+* Don't run Sphinx on Travis Python 3.3 target (#250)
+* Make twistedsupport and tests work on Python 3
+
2.2.0
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/NEWS new/testtools-2.3.0/NEWS
--- old/testtools-2.2.0/NEWS 2016-05-19 01:41:38.000000000 +0200
+++ new/testtools-2.3.0/NEWS 2017-05-11 15:44:09.000000000 +0200
@@ -3,8 +3,25 @@
Changes and improvements to testtools_, grouped by release.
-NEXT
-~~~~
+2.3.0
+~~~~~
+
+Improvements
+------------
+
+* New ``ResourcedToStreamDecorator`` for tracking lifecycle events of
+ test resources, and possibly integrate with subunit. (Free Ekanayaka,
+ Github #243)
+
+* Make ``KeysEqual`` usable with no arguments, i.e. match a dict with
+ no keys. (Gavin Panella, Github #241)
+
+* Add ``testtools.assertions`` to the documented API modules. (Free
+ Ekanayaka, Github #257).
+
+* Don't add file details without content. (Thomas Herve, Github #252)
+
+* Make ``testtools.twistedsupport and tests work on Python 3. (Free Ekanayaka)
2.2.0
~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/PKG-INFO new/testtools-2.3.0/PKG-INFO
--- old/testtools-2.2.0/PKG-INFO 2016-05-19 01:42:20.000000000 +0200
+++ new/testtools-2.3.0/PKG-INFO 2017-05-11 15:48:50.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: testtools
-Version: 2.2.0
+Version: 2.3.0
Summary: Extensions to the Python standard library unit testing framework
Home-page: https://github.com/testing-cabal/testtools
Author: Jonathan M. Lange
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/doc/api.rst
new/testtools-2.3.0/doc/api.rst
--- old/testtools-2.2.0/doc/api.rst 2016-02-29 00:17:04.000000000 +0100
+++ new/testtools-2.3.0/doc/api.rst 2017-02-25 18:03:53.000000000 +0100
@@ -18,6 +18,14 @@
.. automodule:: testtools
:members:
+testtools.assertions
+--------------------
+
+.. automodule:: testtools.assertions
+ :members:
+
+
+
testtools.matchers
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/setup.cfg
new/testtools-2.3.0/setup.cfg
--- old/testtools-2.2.0/setup.cfg 2016-05-19 01:42:20.000000000 +0200
+++ new/testtools-2.3.0/setup.cfg 2017-05-11 15:48:50.000000000 +0200
@@ -12,6 +12,7 @@
[extras]
test =
testscenarios
+ testresources
unittest2>=1.1.0
[files]
@@ -21,7 +22,7 @@
universal = 1
[egg_info]
-tag_build =
tag_date = 0
tag_svn_revision = 0
+tag_build =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/__init__.py
new/testtools-2.3.0/testtools/__init__.py
--- old/testtools-2.2.0/testtools/__init__.py 2016-02-29 00:29:01.000000000
+0100
+++ new/testtools-2.3.0/testtools/__init__.py 2017-05-11 15:41:03.000000000
+0200
@@ -18,6 +18,7 @@
'MultiTestResult',
'PlaceHolder',
'run_test_with',
+ 'ResourcedToStreamDecorator',
'Tagger',
'TestCase',
'TestCommand',
@@ -85,6 +86,7 @@
ExtendedToOriginalDecorator,
ExtendedToStreamDecorator,
MultiTestResult,
+ ResourcedToStreamDecorator,
StreamFailFast,
StreamResult,
StreamResultRouter,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/assertions.py
new/testtools-2.3.0/testtools/assertions.py
--- old/testtools-2.2.0/testtools/assertions.py 2014-08-21 04:57:56.000000000
+0200
+++ new/testtools-2.3.0/testtools/assertions.py 2017-02-25 18:03:53.000000000
+0100
@@ -1,3 +1,7 @@
+# Copyright (c) 2008-2017 testtools developers. See LICENSE for details.
+
+"""Assertion helpers."""
+
from testtools.matchers import (
Annotate,
MismatchError,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/matchers/_dict.py
new/testtools-2.3.0/testtools/matchers/_dict.py
--- old/testtools-2.2.0/testtools/matchers/_dict.py 2013-11-24
03:32:31.000000000 +0100
+++ new/testtools-2.3.0/testtools/matchers/_dict.py 2017-05-11
15:41:03.000000000 +0200
@@ -235,15 +235,17 @@
def __init__(self, *expected):
"""Create a `KeysEqual` Matcher.
- :param expected: The keys the dict is expected to have. If a dict,
- then we use the keys of that dict, if a collection, we assume it
- is a collection of expected keys.
+ :param expected: The keys the matchee is expected to have. As a
+ special case, if a single argument is specified, and it is a
+ mapping, then we use its keys as the expected set.
"""
super(KeysEqual, self).__init__()
- try:
- self.expected = expected[0].keys()
- except AttributeError:
- self.expected = list(expected)
+ if len(expected) == 1:
+ try:
+ expected = expected[0].keys()
+ except AttributeError:
+ pass
+ self.expected = list(expected)
def __str__(self):
return "KeysEqual(%s)" % ', '.join(map(repr, self.expected))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/testresult/__init__.py
new/testtools-2.3.0/testtools/testresult/__init__.py
--- old/testtools-2.2.0/testtools/testresult/__init__.py 2014-09-03
06:08:31.000000000 +0200
+++ new/testtools-2.3.0/testtools/testresult/__init__.py 2017-05-11
15:41:03.000000000 +0200
@@ -7,6 +7,7 @@
'ExtendedToOriginalDecorator',
'ExtendedToStreamDecorator',
'MultiTestResult',
+ 'ResourcedToStreamDecorator',
'StreamFailFast',
'StreamResult',
'StreamResultRouter',
@@ -30,6 +31,7 @@
ExtendedToOriginalDecorator,
ExtendedToStreamDecorator,
MultiTestResult,
+ ResourcedToStreamDecorator,
StreamFailFast,
StreamResult,
StreamResultRouter,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/testresult/doubles.py
new/testtools-2.3.0/testtools/testresult/doubles.py
--- old/testtools-2.2.0/testtools/testresult/doubles.py 2016-02-29
00:17:04.000000000 +0100
+++ new/testtools-2.3.0/testtools/testresult/doubles.py 2017-05-11
15:41:03.000000000 +0200
@@ -2,6 +2,10 @@
"""Doubles of test result objects, useful for testing unittest code."""
+from collections import namedtuple
+
+from testtools.tags import TagContext
+
__all__ = [
'Python26TestResult',
'Python27TestResult',
@@ -11,9 +15,6 @@
]
-from testtools.tags import TagContext
-
-
class LoggingBase(object):
"""Basic support for logging of results."""
@@ -219,6 +220,14 @@
runnable=True, file_name=None, file_bytes=None, eof=False,
mime_type=None, route_code=None, timestamp=None):
self._events.append(
- ('status', test_id, test_status, test_tags,
- runnable, file_name, file_bytes, eof, mime_type, route_code,
- timestamp))
+ _StatusEvent(
+ 'status', test_id, test_status, test_tags, runnable,
+ file_name, file_bytes, eof, mime_type, route_code,
+ timestamp))
+
+
+# Convenience for easier access to status fields
+_StatusEvent = namedtuple(
+ "_Event", [
+ "name", "test_id", "test_status", "test_tags", "runnable", "file_name",
+ "file_bytes", "eof", "mime_type", "route_code", "timestamp"])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/testresult/real.py
new/testtools-2.3.0/testtools/testresult/real.py
--- old/testtools-2.2.0/testtools/testresult/real.py 2016-03-10
22:16:38.000000000 +0100
+++ new/testtools-2.3.0/testtools/testresult/real.py 2017-05-11
15:41:03.000000000 +0200
@@ -6,6 +6,7 @@
'ExtendedToOriginalDecorator',
'ExtendedToStreamDecorator',
'MultiTestResult',
+ 'ResourcedToStreamDecorator',
'StreamFailFast',
'StreamResult',
'StreamSummary',
@@ -832,7 +833,7 @@
case = case.got_timestamp(timestamp)
- if file_name is not None:
+ if file_name is not None and file_bytes:
case = case.got_file(file_name, file_bytes, mime_type)
if test_tags is not None:
@@ -1688,6 +1689,58 @@
return super(ExtendedToStreamDecorator, self).wasSuccessful()
+class ResourcedToStreamDecorator(ExtendedToStreamDecorator):
+ """Report ``testresources``-related activity to StreamResult objects.
+
+ Implement the resource lifecycle TestResult protocol extension supported
+ by the ``testresources.TestResourceManager`` class. At each stage of a
+ resource's lifecycle, a stream event with relevant details will be
+ emitted.
+
+ Each stream event will have its test_id field set to the resource manager's
+ identifier (see ``testresources.TestResourceManager.id()``) plus the method
+ being executed (either 'make' or 'clean').
+
+ The test_status will be either 'inprogress' or 'success'.
+
+ The runnable flag will be set to False.
+ """
+
+ def startMakeResource(self, resource):
+ self._convertResourceLifecycle(resource, 'make', 'start')
+
+ def stopMakeResource(self, resource):
+ self._convertResourceLifecycle(resource, 'make', 'stop')
+
+ def startCleanResource(self, resource):
+ self._convertResourceLifecycle(resource, 'clean', 'start')
+
+ def stopCleanResource(self, resource):
+ self._convertResourceLifecycle(resource, 'clean', 'stop')
+
+ def _convertResourceLifecycle(self, resource, method, phase):
+ """Convert a resource lifecycle report to a stream event."""
+
+ # If the resource implements the TestResourceManager.id() API, let's
+ # use it, otherwise fallback to the class name.
+ if safe_hasattr(resource, "id"):
+ resource_id = resource.id()
+ else:
+ resource_id = "%s.%s" % (
+ resource.__class__.__module__, resource.__class__.__name__)
+
+ test_id = '%s.%s' % (resource_id, method)
+
+ if phase == 'start':
+ test_status = 'inprogress'
+ else:
+ test_status = 'success'
+
+ self.status(
+ test_id=test_id, test_status=test_status, runnable=False,
+ timestamp=self._now())
+
+
class StreamToExtendedDecorator(StreamResult):
"""Convert StreamResult API calls into ExtendedTestResult calls.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/testtools-2.2.0/testtools/tests/matchers/test_dict.py
new/testtools-2.3.0/testtools/tests/matchers/test_dict.py
--- old/testtools-2.2.0/testtools/tests/matchers/test_dict.py 2016-01-09
19:48:09.000000000 +0100
+++ new/testtools-2.3.0/testtools/tests/matchers/test_dict.py 2017-05-11
15:41:03.000000000 +0200
@@ -30,6 +30,30 @@
]
+class TestKeysEqualEmpty(TestCase, TestMatchersInterface):
+
+ matches_matcher = KeysEqual()
+ matches_matches = [
+ {},
+ ]
+ matches_mismatches = [
+ {'foo': 0, 'bar': 1},
+ {'foo': 0},
+ {'bar': 1},
+ {'foo': 0, 'bar': 1, 'baz': 2},
+ {'a': None, 'b': None, 'c': None},
+ ]
+
+ str_examples = [
+ ("KeysEqual()", KeysEqual()),
+ ]
+
+ describe_examples = [
+ ("[] does not match {1: 2}: Keys not equal",
+ {1: 2}, matches_matcher),
+ ]
+
+
class TestKeysEqualWithList(TestCase, TestMatchersInterface):
matches_matcher = KeysEqual('foo', 'bar')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/tests/test_testresult.py
new/testtools-2.3.0/testtools/tests/test_testresult.py
--- old/testtools-2.2.0/testtools/tests/test_testresult.py 2016-02-29
00:17:04.000000000 +0100
+++ new/testtools-2.3.0/testtools/tests/test_testresult.py 2017-05-11
15:41:03.000000000 +0200
@@ -15,17 +15,19 @@
import tempfile
import threading
from unittest import TestSuite
-
-from extras import safe_hasattr, try_imports
+from extras import safe_hasattr, try_imports, try_import
Queue = try_imports(['Queue.Queue', 'queue.Queue'])
+testresources = try_import('testresources')
+
from testtools import (
CopyStreamResult,
ExtendedToOriginalDecorator,
ExtendedToStreamDecorator,
MultiTestResult,
PlaceHolder,
+ ResourcedToStreamDecorator,
StreamFailFast,
StreamResult,
StreamResultRouter,
@@ -590,6 +592,12 @@
return ExtendedToStreamDecorator(StreamResult())
+class TestResourcedToStreamDecoratorContract(TestCase,
TestStreamResultContract):
+
+ def _make_result(self):
+ return ResourcedToStreamDecorator(StreamResult())
+
+
class TestStreamSummaryResultContract(TestCase, TestStreamResultContract):
def _make_result(self):
@@ -825,6 +833,18 @@
self.assertEqual(["A", "B"], tests[0]['timestamps'])
self.assertEqual(["C", None], tests[1]['timestamps'])
+ def test_files_skipped(self):
+ tests = []
+ result = StreamToDict(tests.append)
+ result.startTestRun()
+ result.status(file_name="some log.txt",
+ file_bytes="", eof=True,
+ mime_type="text/plain; charset=utf8", test_id="foo.bar")
+ result.stopTestRun()
+ self.assertThat(tests, HasLength(1))
+ details = tests[0]['details']
+ self.assertNotIn("some log.txt", details)
+
class TestExtendedToStreamDecorator(TestCase):
@@ -920,6 +940,71 @@
('stopTestRun',)], log._events)
+class TestResourcedToStreamDecorator(TestCase):
+
+ def setUp(self):
+ super(TestResourcedToStreamDecorator, self).setUp()
+ if testresources is None:
+ self.skipTest('Need testresources')
+
+ def test_startMakeResource(self):
+ log = LoggingStreamResult()
+ result = ResourcedToStreamDecorator(log)
+ timestamp = datetime.datetime.utcfromtimestamp(3.476)
+ result.startTestRun()
+ result.time(timestamp)
+ resource = testresources.TestResourceManager()
+ result.startMakeResource(resource)
+ [_, event] = log._events
+ self.assertEqual(
+ 'testresources.TestResourceManager.make', event.test_id)
+ self.assertEqual('inprogress', event.test_status)
+ self.assertFalse(event.runnable)
+ self.assertEqual(timestamp, event.timestamp)
+
+ def test_startMakeResource_with_custom_id_method(self):
+ log = LoggingStreamResult()
+ result = ResourcedToStreamDecorator(log)
+ resource = testresources.TestResourceManager()
+ resource.id = lambda: 'nice.resource'
+ result.startTestRun()
+ result.startMakeResource(resource)
+ self.assertEqual('nice.resource.make', log._events[1].test_id)
+
+ def test_stopMakeResource(self):
+ log = LoggingStreamResult()
+ result = ResourcedToStreamDecorator(log)
+ resource = testresources.TestResourceManager()
+ result.startTestRun()
+ result.stopMakeResource(resource)
+ [_, event] = log._events
+ self.assertEqual(
+ 'testresources.TestResourceManager.make', event.test_id)
+ self.assertEqual('success', event.test_status)
+
+ def test_startCleanResource(self):
+ log = LoggingStreamResult()
+ result = ResourcedToStreamDecorator(log)
+ resource = testresources.TestResourceManager()
+ result.startTestRun()
+ result.startCleanResource(resource)
+ [_, event] = log._events
+ self.assertEqual(
+ 'testresources.TestResourceManager.clean', event.test_id)
+ self.assertEqual('inprogress', event.test_status)
+
+ def test_stopCleanResource(self):
+ log = LoggingStreamResult()
+ result = ResourcedToStreamDecorator(log)
+ resource = testresources.TestResourceManager()
+ result.startTestRun()
+ result.stopCleanResource(resource)
+ [_, event] = log._events
+ self.assertEqual(
+ 'testresources.TestResourceManager.clean', event.test_id)
+ self.assertEqual('success', event.test_status)
+
+
class TestStreamFailFast(TestCase):
def test_inprogress(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/testtools-2.2.0/testtools/tests/twistedsupport/test_spinner.py
new/testtools-2.3.0/testtools/tests/twistedsupport/test_spinner.py
--- old/testtools-2.2.0/testtools/tests/twistedsupport/test_spinner.py
2016-02-29 00:17:04.000000000 +0100
+++ new/testtools-2.3.0/testtools/tests/twistedsupport/test_spinner.py
2017-02-07 10:05:09.000000000 +0100
@@ -137,8 +137,8 @@
def test_preserve_signal_handler(self):
signals = ['SIGINT', 'SIGTERM', 'SIGCHLD']
- signals = filter(
- None, (getattr(signal, name, None) for name in signals))
+ signals = list(filter(
+ None, (getattr(signal, name, None) for name in signals)))
for sig in signals:
self.addCleanup(signal.signal, sig, signal.getsignal(sig))
new_hdlrs = list(lambda *a: None for _ in signals)
@@ -146,7 +146,7 @@
signal.signal(sig, hdlr)
spinner = self.make_spinner()
spinner.run(self.make_timeout(), lambda: None)
- self.assertEqual(new_hdlrs, map(signal.getsignal, signals))
+ self.assertItemsEqual(new_hdlrs, list(map(signal.getsignal, signals)))
def test_timeout(self):
# If the function takes too long to run, we raise a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools/twistedsupport/_spinner.py
new/testtools-2.3.0/testtools/twistedsupport/_spinner.py
--- old/testtools-2.2.0/testtools/twistedsupport/_spinner.py 2016-02-29
00:17:04.000000000 +0100
+++ new/testtools-2.3.0/testtools/twistedsupport/_spinner.py 2017-02-07
10:05:09.000000000 +0100
@@ -19,6 +19,8 @@
from fixtures import Fixture
import signal
+import six
+
from ._deferreddebug import DebugTwisted
from twisted.internet import defer
@@ -68,10 +70,31 @@
"""
real_DebugInfo = defer.DebugInfo
debug_infos = []
- def DebugInfo():
- info = real_DebugInfo()
- debug_infos.append(info)
- return info
+
+ # Apparently the fact that Twisted now decorates DebugInfo with @_oldStyle
+ # screws up things a bit for us here: monkey patching the __del__ method on
+ # an instance doesn't work with Python 3 and viceversa overriding __del__
+ # via inheritance doesn't work with Python 2. So we handle the two cases
+ # differently. TODO: perhaps there's a way to have a single code path?
+ if six.PY2:
+ def DebugInfo():
+ info = real_DebugInfo()
+ debug_infos.append(info)
+ return info
+ else:
+
+ class DebugInfo(real_DebugInfo):
+
+ _runRealDel = True
+
+ def __init__(self):
+ real_DebugInfo.__init__(self)
+ debug_infos.append(self)
+
+ def __del__(self):
+ if self._runRealDel:
+ real_DebugInfo.__del__(self)
+
defer.DebugInfo = DebugInfo
try:
result = function(*args, **kwargs)
@@ -83,7 +106,10 @@
errors.append(info)
# Disable the destructor that logs to error. We are already
# catching the error here.
- info.__del__ = lambda: None
+ if six.PY2:
+ info.__del__ = lambda: None
+ else:
+ info._runRealDel = False
return result, errors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools.egg-info/PKG-INFO
new/testtools-2.3.0/testtools.egg-info/PKG-INFO
--- old/testtools-2.2.0/testtools.egg-info/PKG-INFO 2016-05-19
01:42:20.000000000 +0200
+++ new/testtools-2.3.0/testtools.egg-info/PKG-INFO 2017-05-11
15:48:49.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: testtools
-Version: 2.2.0
+Version: 2.3.0
Summary: Extensions to the Python standard library unit testing framework
Home-page: https://github.com/testing-cabal/testtools
Author: Jonathan M. Lange
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools.egg-info/pbr.json
new/testtools-2.3.0/testtools.egg-info/pbr.json
--- old/testtools-2.2.0/testtools.egg-info/pbr.json 2016-05-19
01:42:20.000000000 +0200
+++ new/testtools-2.3.0/testtools.egg-info/pbr.json 2017-05-11
15:48:49.000000000 +0200
@@ -1 +1 @@
-{"is_release": true, "git_version": "bfc88a4"}
\ No newline at end of file
+{"is_release": true, "git_version": "b4d158a"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/testtools-2.2.0/testtools.egg-info/requires.txt
new/testtools-2.3.0/testtools.egg-info/requires.txt
--- old/testtools-2.2.0/testtools.egg-info/requires.txt 2016-05-19
01:42:20.000000000 +0200
+++ new/testtools-2.3.0/testtools.egg-info/requires.txt 2017-05-11
15:48:49.000000000 +0200
@@ -8,4 +8,5 @@
[test]
testscenarios
+testresources
unittest2>=1.1.0