Hello community,
here is the log from the commit of package python3-fixtures for openSUSE:Factory checked in at 2016-04-11 09:14:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-fixtures (Old)
and /work/SRC/openSUSE:Factory/.python3-fixtures.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-fixtures"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-fixtures/python3-fixtures.changes 2016-03-18 21:42:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-fixtures.new/python3-fixtures.changes 2016-04-11 10:26:56.000000000 +0200
@@ -1,0 +2,13 @@
+Sat Apr 9 16:19:22 UTC 2016 - arun@gmx.de
+
+- update to version 2.0.0:
+ * Monkeypatching of staticmethod's now works correctly on Python 2
+ and 3. This is an API break as previously they were bound as
+ instancemethods's and thus any working patches need to have their
+ first parameter (self) dropped. (Andrew Laski)
+ * New class "CompoundFixture" added, allowing fixtures to be
+ combined. (Jonathan Lange)
+ * Support for Python 3.2 dropped (as pip and setuptools have).
+ (Robert Collins)
+
+-------------------------------------------------------------------
Old:
----
fixtures-1.4.0.tar.gz
New:
----
fixtures-2.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-fixtures.spec ++++++
--- /var/tmp/diff_new_pack.xhiiyn/_old 2016-04-11 10:26:56.000000000 +0200
+++ /var/tmp/diff_new_pack.xhiiyn/_new 2016-04-11 10:26:56.000000000 +0200
@@ -17,7 +17,7 @@
Name: python3-fixtures
-Version: 1.4.0
+Version: 2.0.0
Release: 0
Summary: Fixtrues, reusable state for writing clean tests and more
License: Apache-2.0 or BSD-3-Clause
++++++ fixtures-1.4.0.tar.gz -> fixtures-2.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/.travis.yml new/fixtures-2.0.0/.travis.yml
--- old/fixtures-1.4.0/.travis.yml 2015-10-08 02:18:09.000000000 +0200
+++ new/fixtures-2.0.0/.travis.yml 2016-04-07 02:32:14.000000000 +0200
@@ -4,7 +4,6 @@
python:
- "2.6"
- "2.7"
- - "3.2"
- "3.3"
- "3.4"
- "3.5"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/AUTHORS new/fixtures-2.0.0/AUTHORS
--- old/fixtures-1.4.0/AUTHORS 2015-10-08 03:09:33.000000000 +0200
+++ new/fixtures-2.0.0/AUTHORS 2016-04-07 03:19:48.000000000 +0200
@@ -1,3 +1,4 @@
+Andrew Laski
Clark Boylan
Dan Kenigsberg
Francesco Banconi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/ChangeLog new/fixtures-2.0.0/ChangeLog
--- old/fixtures-1.4.0/ChangeLog 2015-10-08 03:09:33.000000000 +0200
+++ new/fixtures-2.0.0/ChangeLog 2016-04-07 03:19:48.000000000 +0200
@@ -1,6 +1,19 @@
CHANGES
=======
+2.0.0
+-----
+
+* Fixup NEWS, release 2.0
+* MonkeyPatch staticmethod
+* Drop support for Python 3.2. It's history
+* Fix print in README
+* Add CompoundFixture
+* Tweak hacking docs
+* Fix "propagate" spelling everywhere
+* Missed one: propogate -> propagate
+* Spelling and lint fixes
+
1.4
---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/HACKING new/fixtures-2.0.0/HACKING
--- old/fixtures-1.4.0/HACKING 2015-07-01 23:37:33.000000000 +0200
+++ new/fixtures-2.0.0/HACKING 2016-03-23 23:55:38.000000000 +0100
@@ -40,7 +40,9 @@
1. commit, tag::
- git push --tags origin master:master
+ git commit -am "Release X.Y.Z"
+ git tag -m "Release X.Y.Z" X.Y.Z
+ git push --tags origin master:master
1. Upload to pypi, signed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/NEWS new/fixtures-2.0.0/NEWS
--- old/fixtures-1.4.0/NEWS 2015-10-08 03:06:14.000000000 +0200
+++ new/fixtures-2.0.0/NEWS 2016-04-07 03:17:41.000000000 +0200
@@ -6,6 +6,20 @@
NEXT
~~~~
+2.0
+~~~
+
+* Monkeypatching of staticmethod's now works correctly on Python 2 and 3.
+ This is an API break as previously they were bound as instancemethods's
+ and thus any working patches need to have their first parameter (self)
+ dropped. (Andrew Laski)
+
+* New class ``CompoundFixture`` added, allowing fixtures to be combined.
+ (Jonathan Lange)
+
+* Support for Python 3.2 dropped (as pip and setuptools have).
+ (Robert Collins)
+
1.4
~~~
@@ -35,7 +49,7 @@
* Fixture.setUp should no longer be overridden in subclasses. Instead
override _setUp. This permits the Fixture base class to detect failures
during _setUp and trigger any registered cleanups, attach any details
- to the failure exception and propogate that to callers. Overriding of
+ to the failure exception and propagate that to callers. Overriding of
setUp is still supported: this adds a new interface for simpler
implementation of the contract of a fixture.
(Robert Collins, #1456361, #1456353)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/PKG-INFO new/fixtures-2.0.0/PKG-INFO
--- old/fixtures-1.4.0/PKG-INFO 2015-10-08 03:09:34.000000000 +0200
+++ new/fixtures-2.0.0/PKG-INFO 2016-04-07 03:19:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: fixtures
-Version: 1.4.0
+Version: 2.0.0
Summary: Fixtures, reusable state for writing clean tests and more.
Home-page: https://launchpad.net/python-fixtures
Author: Robert Collins
@@ -33,7 +33,7 @@
Dependencies
============
- * Python 2.6+
+ * Python 2.6+, or 3.3+
This is the base language fixtures is written in and for.
* pbr
@@ -64,7 +64,7 @@
Standard Python unittest.py provides no obvious method for making and reusing
state needed in a test case other than by adding a method on the test class.
- This scales poorly - complex helper functions propogating up a test class
+ This scales poorly - complex helper functions propagating up a test class
hierarchy is a regular pattern when this is done. Mocking while a great tool
doesn't itself prevent this (and helpers to mock complex things can accumulate
in the same way if placed on the test class).
@@ -154,6 +154,14 @@
>>> server = MyServer()
>>> fixture = fixtures.MethodFixture(server, server.start, server.stop)
+ You can also combine existing fixtures using ``CompoundFixture``::
+
+ >>> noddy_with_log = fixtures.CompoundFixture([NoddyFixture(),
+ ... WithLog()])
+ >>> with noddy_with_log as x:
+ ... print (x.fixtures[0].frobnozzle)
+ 42
+
The Fixture API
===============
@@ -238,7 +246,7 @@
class implementation of ``setUp`` acts to reduce the chance of leaking
external resources if an error is raised from ``_setUp``. Specifically,
``setUp`` contains a try:/except: block which catches all exceptions, captures
- any registered detail objects, and calls ``self.cleanUp`` before propogating
+ any registered detail objects, and calls ``self.cleanUp`` before propagating
the error. As long as you take care to register any cleanups before calling
the code that may fail, this will cause them to be cleaned up. The captured
detail objects are provided to the args of the raised exception.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/README new/fixtures-2.0.0/README
--- old/fixtures-1.4.0/README 2015-06-30 02:56:38.000000000 +0200
+++ new/fixtures-2.0.0/README 2016-04-07 02:32:14.000000000 +0200
@@ -25,7 +25,7 @@
Dependencies
============
-* Python 2.6+
+* Python 2.6+, or 3.3+
This is the base language fixtures is written in and for.
* pbr
@@ -56,7 +56,7 @@
Standard Python unittest.py provides no obvious method for making and reusing
state needed in a test case other than by adding a method on the test class.
-This scales poorly - complex helper functions propogating up a test class
+This scales poorly - complex helper functions propagating up a test class
hierarchy is a regular pattern when this is done. Mocking while a great tool
doesn't itself prevent this (and helpers to mock complex things can accumulate
in the same way if placed on the test class).
@@ -146,6 +146,14 @@
server = MyServer()
fixture = fixtures.MethodFixture(server, server.start, server.stop)
+You can also combine existing fixtures using ``CompoundFixture``::
+
+ >>> noddy_with_log = fixtures.CompoundFixture([NoddyFixture(),
+ ... WithLog()])
+ >>> with noddy_with_log as x:
+ ... print (x.fixtures[0].frobnozzle)
+ 42
+
The Fixture API
===============
@@ -230,7 +238,7 @@
class implementation of ``setUp`` acts to reduce the chance of leaking
external resources if an error is raised from ``_setUp``. Specifically,
``setUp`` contains a try:/except: block which catches all exceptions, captures
-any registered detail objects, and calls ``self.cleanUp`` before propogating
+any registered detail objects, and calls ``self.cleanUp`` before propagating
the error. As long as you take care to register any cleanups before calling
the code that may fail, this will cause them to be cleaned up. The captured
detail objects are provided to the args of the raised exception.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/__init__.py new/fixtures-2.0.0/fixtures/__init__.py
--- old/fixtures-1.4.0/fixtures/__init__.py 2015-06-22 08:56:00.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/__init__.py 2016-03-23 23:55:38.000000000 +0100
@@ -44,6 +44,7 @@
__all__ = [
'ByteStream',
+ 'CompoundFixture',
'DetailStream',
'EnvironmentVariable',
'EnvironmentVariableFixture',
@@ -78,6 +79,7 @@
from fixtures.fixture import (
+ CompoundFixture,
Fixture,
FunctionFixture,
MethodFixture,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/_fixtures/monkeypatch.py new/fixtures-2.0.0/fixtures/_fixtures/monkeypatch.py
--- old/fixtures-1.4.0/fixtures/_fixtures/monkeypatch.py 2015-06-22 08:56:00.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/_fixtures/monkeypatch.py 2016-04-07 02:32:40.000000000 +0200
@@ -23,6 +23,23 @@
from fixtures import Fixture
+def _setattr(obj, name, value):
+ """Handle some corner cases when calling setattr.
+
+ setattr transforms a function into instancemethod, so where appropriate
+ value needs to be wrapped with staticmethod().
+ """
+ if sys.version_info[0] == 2:
+ class_types = (type, types.ClassType)
+ else:
+ # All classes are in Python 3
+ class_types = type
+ if (isinstance(obj, class_types) and
+ isinstance(value, types.FunctionType)):
+ value = staticmethod(value)
+ setattr(obj, name, value)
+
+
class MonkeyPatch(Fixture):
"""Replace or delete an attribute."""
@@ -60,16 +77,11 @@
if old_value is not sentinel:
delattr(current, attribute)
else:
- setattr(current, attribute, self.new_value)
+ _setattr(current, attribute, self.new_value)
if old_value is sentinel:
self.addCleanup(self._safe_delete, current, attribute)
else:
- # Python 2's setattr transforms function into instancemethod
- if (sys.version_info[0] == 2 and
- isinstance(current, (type, types.ClassType)) and
- isinstance(old_value, types.FunctionType)):
- old_value = staticmethod(old_value)
- self.addCleanup(setattr, current, attribute, old_value)
+ self.addCleanup(_setattr, current, attribute, old_value)
def _safe_delete(self, obj, attribute):
"""Delete obj.attribute handling the case where its missing."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/callmany.py new/fixtures-2.0.0/fixtures/callmany.py
--- old/fixtures-1.4.0/fixtures/callmany.py 2014-09-25 04:31:06.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/callmany.py 2016-03-23 23:55:38.000000000 +0100
@@ -67,7 +67,8 @@
re-raised after all the functions have run. If multiple exceptions
are raised, they are all wrapped into a MultipleExceptions object,
and that is raised.
- Thus, to cach a specific exception from a function run by __call__,
+
+ Thus, to catch a specific exception from a function run by __call__,
you need to catch both the exception and MultipleExceptions, and
then check within a MultipleExceptions instance for an occurance of
the type you wish to catch.
@@ -96,5 +97,4 @@
def __exit__(self, exc_type, exc_val, exc_tb):
self()
- return False # propogate exceptions from the with body.
-
+ return False # Propagate exceptions from the with body.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/fixture.py new/fixtures-2.0.0/fixtures/fixture.py
--- old/fixtures-1.4.0/fixtures/fixture.py 2015-06-30 03:01:38.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/fixture.py 2016-03-23 23:55:38.000000000 +0100
@@ -14,6 +14,7 @@
# limitations under that license.
__all__ = [
+ 'CompoundFixture',
'Fixture',
'FunctionFixture',
'MethodFixture',
@@ -27,7 +28,6 @@
import six
from testtools.compat import (
advance_iterator,
- reraise,
)
from testtools.helpers import try_import
@@ -115,7 +115,7 @@
if a single exception is raised, it is reraised after all the
cleanUps have run. If multiple exceptions are raised, they are
all wrapped into a MultipleExceptions object, and that is reraised.
- Thus, to cach a specific exception from cleanUp, you need to catch
+ Thus, to catch a specific exception from cleanUp, you need to catch
both the exception and MultipleExceptions, and then check within
a MultipleExceptions instance for the type you're catching.
:return: A list of the exc_info() for each exception that occured if
@@ -157,7 +157,7 @@
self._cleanups()
finally:
self._remove_state()
- return False # propogate exceptions from the with body.
+ return False # propagate exceptions from the with body.
def getDetails(self):
"""Get the current details registered with the fixture.
@@ -206,7 +206,7 @@
errors = [err] + self.cleanUp(raise_first=False)
try:
raise SetupError(details)
- except SetupError as e:
+ except SetupError:
errors.append(sys.exc_info())
if issubclass(err[0], Exception):
raise MultipleExceptions(*errors)
@@ -381,12 +381,12 @@
if setup is None:
setup = getattr(obj, 'setUp', None)
if setup is None:
- setup = lambda:None
+ setup = lambda: None
self._setup = setup
if cleanup is None:
cleanup = getattr(obj, 'tearDown', None)
if cleanup is None:
- cleanup = lambda:None
+ cleanup = lambda: None
self._cleanup = cleanup
if reset is None:
reset = getattr(obj, 'reset', None)
@@ -404,3 +404,22 @@
super(MethodFixture, self).reset()
else:
self._reset()
+
+
+class CompoundFixture(Fixture):
+ """A fixture that combines many fixtures.
+
+ :ivar fixtures: The list of fixtures that make up this one. (read only).
+ """
+
+ def __init__(self, fixtures):
+ """Construct a fixture made of many fixtures.
+
+ :param fixtures: An iterable of fixtures.
+ """
+ super(CompoundFixture, self).__init__()
+ self.fixtures = list(fixtures)
+
+ def _setUp(self):
+ for fixture in self.fixtures:
+ self.useFixture(fixture)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/tests/_fixtures/test_monkeypatch.py new/fixtures-2.0.0/fixtures/tests/_fixtures/test_monkeypatch.py
--- old/fixtures-1.4.0/fixtures/tests/_fixtures/test_monkeypatch.py 2014-09-25 04:31:06.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/tests/_fixtures/test_monkeypatch.py 2016-04-07 02:32:40.000000000 +0200
@@ -78,6 +78,8 @@
'fixtures.tests._fixtures.test_monkeypatch.C.foo',
bar)
with fixture:
- pass
+ C.foo()
+ C().foo()
self.assertEqual(oldfoo, C.foo)
+ self.assertEqual(oldfoo, C().foo)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/tests/test_callmany.py new/fixtures-2.0.0/fixtures/tests/test_callmany.py
--- old/fixtures-1.4.0/fixtures/tests/test_callmany.py 2014-09-25 04:31:06.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/tests/test_callmany.py 2016-03-23 23:55:38.000000000 +0100
@@ -45,7 +45,7 @@
self.assertEqual(('woo',), value.args)
self.assertIsInstance(tb, types.TracebackType)
- def test_exit_propogates_exceptions(self):
+ def test_exit_propagates_exceptions(self):
call = CallMany()
call.__enter__()
self.assertEqual(False, call.__exit__(None, None, None))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures/tests/test_fixture.py new/fixtures-2.0.0/fixtures/tests/test_fixture.py
--- old/fixtures-1.4.0/fixtures/tests/test_fixture.py 2015-06-30 02:51:08.000000000 +0200
+++ new/fixtures-2.0.0/fixtures/tests/test_fixture.py 2016-03-23 23:55:38.000000000 +0100
@@ -84,7 +84,7 @@
self.assertEqual(('woo',), value.args)
self.assertIsInstance(tb, types.TracebackType)
- def test_exit_propogates_exceptions(self):
+ def test_exit_propagates_exceptions(self):
fixture = fixtures.Fixture()
fixture.__enter__()
self.assertEqual(False, fixture.__exit__(None, None, None))
@@ -259,7 +259,7 @@
def test_setup_failures_with_base_exception(self):
# when _setUp fails with a BaseException (or subclass thereof) that
- # exception is propogated as is, but we still call cleanups etc.
+ # exception is propagated as is, but we still call cleanups etc.
class MyBase(BaseException):pass
log = []
class Subclass(fixtures.Fixture):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures.egg-info/PKG-INFO new/fixtures-2.0.0/fixtures.egg-info/PKG-INFO
--- old/fixtures-1.4.0/fixtures.egg-info/PKG-INFO 2015-10-08 03:09:33.000000000 +0200
+++ new/fixtures-2.0.0/fixtures.egg-info/PKG-INFO 2016-04-07 03:19:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: fixtures
-Version: 1.4.0
+Version: 2.0.0
Summary: Fixtures, reusable state for writing clean tests and more.
Home-page: https://launchpad.net/python-fixtures
Author: Robert Collins
@@ -33,7 +33,7 @@
Dependencies
============
- * Python 2.6+
+ * Python 2.6+, or 3.3+
This is the base language fixtures is written in and for.
* pbr
@@ -64,7 +64,7 @@
Standard Python unittest.py provides no obvious method for making and reusing
state needed in a test case other than by adding a method on the test class.
- This scales poorly - complex helper functions propogating up a test class
+ This scales poorly - complex helper functions propagating up a test class
hierarchy is a regular pattern when this is done. Mocking while a great tool
doesn't itself prevent this (and helpers to mock complex things can accumulate
in the same way if placed on the test class).
@@ -154,6 +154,14 @@
>>> server = MyServer()
>>> fixture = fixtures.MethodFixture(server, server.start, server.stop)
+ You can also combine existing fixtures using ``CompoundFixture``::
+
+ >>> noddy_with_log = fixtures.CompoundFixture([NoddyFixture(),
+ ... WithLog()])
+ >>> with noddy_with_log as x:
+ ... print (x.fixtures[0].frobnozzle)
+ 42
+
The Fixture API
===============
@@ -238,7 +246,7 @@
class implementation of ``setUp`` acts to reduce the chance of leaking
external resources if an error is raised from ``_setUp``. Specifically,
``setUp`` contains a try:/except: block which catches all exceptions, captures
- any registered detail objects, and calls ``self.cleanUp`` before propogating
+ any registered detail objects, and calls ``self.cleanUp`` before propagating
the error. As long as you take care to register any cleanups before calling
the code that may fail, this will cause them to be cleaned up. The captured
detail objects are provided to the args of the raised exception.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/fixtures.egg-info/pbr.json new/fixtures-2.0.0/fixtures.egg-info/pbr.json
--- old/fixtures-1.4.0/fixtures.egg-info/pbr.json 2015-10-08 03:09:33.000000000 +0200
+++ new/fixtures-2.0.0/fixtures.egg-info/pbr.json 2016-04-07 03:19:48.000000000 +0200
@@ -1 +1 @@
-{"is_release": true, "git_version": "6d941c6"}
\ No newline at end of file
+{"git_version": "820f12b", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.4.0/setup.cfg new/fixtures-2.0.0/setup.cfg
--- old/fixtures-1.4.0/setup.cfg 2015-10-08 03:09:34.000000000 +0200
+++ new/fixtures-2.0.0/setup.cfg 2016-04-07 03:19:48.000000000 +0200
@@ -31,7 +31,7 @@
docutils
[egg_info]
-tag_build =
tag_date = 0
+tag_build =
tag_svn_revision = 0