Hello community, here is the log from the commit of package python-fixtures for openSUSE:Factory checked in at 2015-05-10 10:46:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-fixtures (Old) and /work/SRC/openSUSE:Factory/.python-fixtures.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-fixtures" Changes: -------- --- /work/SRC/openSUSE:Factory/python-fixtures/python-fixtures.changes 2015-03-03 11:15:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-fixtures.new/python-fixtures.changes 2015-05-10 10:46:15.000000000 +0200 @@ -1,0 +2,18 @@ +Tue May 5 11:20:23 UTC 2015 - benoit.mo...@gmx.fr + +- update to version 1.2.0: + * Release 1.2.0 + * Add a warnings module capture fixure + * Use universal wheels +- additional changes from version 1.1.0: + * Release 1.1.0 and use pbr 0.11 features + * Missing NEWS entry + * add tox.ini file + * Fixed test performance on Python 3.5 + * Add NEWS for FakeLogger formatter + * allow the specification of a custom log formatter +- set a minimum version for python-pbr +- reenable the tests via make check: + python-testrepository is not needed anymore + +------------------------------------------------------------------- Old: ---- fixtures-1.0.0.tar.gz New: ---- fixtures-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-fixtures.spec ++++++ --- /var/tmp/diff_new_pack.69tPWd/_old 2015-05-10 10:46:15.000000000 +0200 +++ /var/tmp/diff_new_pack.69tPWd/_new 2015-05-10 10:46:15.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-fixtures -Version: 1.0.0 +Version: 1.2.0 Release: 0 Summary: Fixtures, reusable state for writing clean tests and more License: Apache-2.0 or BSD-3-Clause @@ -25,11 +25,8 @@ Url: https://launchpad.net/python-fixtures Source: http://pypi.python.org/packages/source/f/fixtures/fixtures-%{version}.tar.gz BuildRequires: python-devel -BuildRequires: python-pbr -#BuildRequires: python-testrepository +BuildRequires: python-pbr >= 0.11 BuildRequires: python-testtools >= 0.9.22 -# Test requirements: -#BuildRequires: python-bzrlib.tests BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 BuildRequires: python-discover @@ -56,9 +53,8 @@ %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} -# Create a cycle with python-testrepository; disabled for now -#%check -#testr init && testr run +%check +make check %files %defattr(-,root,root,-) ++++++ fixtures-1.0.0.tar.gz -> fixtures-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/AUTHORS new/fixtures-1.2.0/AUTHORS --- old/fixtures-1.0.0/AUTHORS 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/AUTHORS 2015-05-05 00:14:19.000000000 +0200 @@ -8,6 +8,7 @@ James Westby <james.wes...@linaro.org> Jonathan Lange <j...@canonical.com> Jonathan Lange <j...@mumak.net> +Joshua Harlow <harlo...@yahoo-inc.com> Martin Pool <m...@canonical.com> Robert Collins <robe...@robertcollins.net> Sean Dague <s...@dague.net> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/ChangeLog new/fixtures-1.2.0/ChangeLog --- old/fixtures-1.0.0/ChangeLog 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/ChangeLog 2015-05-05 00:14:19.000000000 +0200 @@ -1,6 +1,23 @@ CHANGES ======= +1.2.0 +----- + +* Release 1.2.0 +* Add a warnings module capture fixure +* Use universal wheels + +1.1.0 +----- + +* Release 1.1.0 and use pbr 0.11 features +* Missing NEWS entry +* add tox.ini file +* Fixed test performance on Python 3.5 +* Add NEWS for FakeLogger formatter +* allow the specification of a custom log formatter + 1.0.0 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/HACKING new/fixtures-1.2.0/HACKING --- old/fixtures-1.0.0/HACKING 2014-09-25 23:09:19.000000000 +0200 +++ new/fixtures-1.2.0/HACKING 2015-05-04 06:05:02.000000000 +0200 @@ -36,12 +36,12 @@ Releasing +++++++++ -1. Update the version number in __init__.py and add a version to NEWS. - -1. Upload to pypi, signed. +1. Add a version to NEWS. 1. commit, tag. +1. Upload to pypi, signed. + 1. Close bugs. 1. Rename the next milestone, release it, and make a new one. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/NEWS new/fixtures-1.2.0/NEWS --- old/fixtures-1.0.0/NEWS 2014-10-27 21:23:42.000000000 +0100 +++ new/fixtures-1.2.0/NEWS 2015-05-04 23:50:18.000000000 +0200 @@ -6,6 +6,25 @@ NEXT ~~~~ +1.2.0 +~~~~~ + +* Add warnings module fixture for capturing warnings. (Joshua Harlow) + +1.1.0 +~~~~~ + +CHANGES +------- + +* FakeLogger now supports a custom formatter. (Sean Dague) + +* Fixed test performance on Python 3.5. PEP 475 led to ``time.sleep()`` not + being interrupted when a received signal handler eats the signal (rather + than raising an exception). (Robert Collins) + +* ``tox.ini`` added, for folk that use tox. (Sean Dague) + 1.0.0 ~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/PKG-INFO new/fixtures-1.2.0/PKG-INFO --- old/fixtures-1.0.0/PKG-INFO 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/PKG-INFO 2015-05-05 00:14:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: fixtures -Version: 1.0.0 +Version: 1.2.0 Summary: Fixtures, reusable state for writing clean tests and more. Home-page: https://launchpad.net/python-fixtures Author: Robert Collins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/__init__.py new/fixtures-1.2.0/fixtures/__init__.py --- old/fixtures-1.0.0/fixtures/__init__.py 2014-10-27 21:23:21.000000000 +0100 +++ new/fixtures-1.2.0/fixtures/__init__.py 2015-05-04 23:49:57.000000000 +0200 @@ -36,13 +36,10 @@ # established at this point, and setup.py will use a version of next-$(revno). # If the releaselevel is 'final', then the tarball will be major.minor.micro. # Otherwise it is major.minor.micro~$(revno). - -# Uncomment when pbr 0.11 is released. -#import pbr.version -#_version = pbr.version.VersionInfo('fixtures').semantic_version() -#__version__ = _version.version_tuple() -#version = _version.release_string() -__version__ = (1, 0, 0, 'final', 0) +from pbr.version import VersionInfo +_version = VersionInfo('fixtures') +__version__ = _version.semantic_version().version_tuple() +version = _version.release_string() __all__ = [ @@ -69,6 +66,7 @@ 'TestWithFixtures', 'Timeout', 'TimeoutException', + 'WarningsCapture', '__version__', 'version', ] @@ -99,6 +97,7 @@ TempHomeDir, Timeout, TimeoutException, + WarningsCapture, ) from fixtures.testcase import TestWithFixtures diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/_fixtures/__init__.py new/fixtures-1.2.0/fixtures/_fixtures/__init__.py --- old/fixtures-1.0.0/fixtures/_fixtures/__init__.py 2014-09-25 04:31:06.000000000 +0200 +++ new/fixtures-1.2.0/fixtures/_fixtures/__init__.py 2015-05-04 23:49:57.000000000 +0200 @@ -36,6 +36,7 @@ 'TempHomeDir', 'Timeout', 'TimeoutException', + 'WarningsCapture', ] @@ -72,3 +73,6 @@ Timeout, TimeoutException, ) +from fixtures._fixtures.warnings import ( + WarningsCapture, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/_fixtures/logger.py new/fixtures-1.2.0/fixtures/_fixtures/logger.py --- old/fixtures-1.0.0/fixtures/_fixtures/logger.py 2014-09-25 22:46:47.000000000 +0200 +++ new/fixtures-1.2.0/fixtures/_fixtures/logger.py 2015-03-26 21:33:59.000000000 +0100 @@ -66,7 +66,7 @@ """Replace a logger and capture its output.""" def __init__(self, name="", level=INFO, format=None, - datefmt=None, nuke_handlers=True): + datefmt=None, nuke_handlers=True, formatter=None): """Create a FakeLogger fixture. :param name: The name of the logger to replace. Defaults to "". @@ -77,6 +77,8 @@ Mirrors the datefmt used in python loggging. :param nuke_handlers: If True remove all existing handles (prevents existing messages going to e.g. stdout). Defaults to True. + :param formatter: a custom log formatter class. Use this if you want + to use a log Formatter other than the default one in python. Example: @@ -91,6 +93,7 @@ self._format = format self._datefmt = datefmt self._nuke_handlers = nuke_handlers + self._formatter = formatter def setUp(self): super(FakeLogger, self).setUp() @@ -99,7 +102,8 @@ self._output = output handler = StreamHandler(output) if self._format: - handler.setFormatter(Formatter(self._format, self._datefmt)) + formatter = (self._formatter or Formatter) + handler.setFormatter(formatter(self._format, self._datefmt)) self.useFixture( LogHandler(handler, name=self._name, level=self._level, nuke_handlers=self._nuke_handlers)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/_fixtures/warnings.py new/fixtures-1.2.0/fixtures/_fixtures/warnings.py --- old/fixtures-1.0.0/fixtures/_fixtures/warnings.py 1970-01-01 01:00:00.000000000 +0100 +++ new/fixtures-1.2.0/fixtures/_fixtures/warnings.py 2015-05-04 23:49:57.000000000 +0200 @@ -0,0 +1,41 @@ +# fixtures: Fixtures with cleanups for testing and convenience. +# +# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause +# license at the users choice. A copy of both licenses are available in the +# project source as Apache-2.0 and BSD. You may not use this file except in +# compliance with one of these two licences. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# license you chose for the specific language governing permissions and +# limitations under that license. + +from __future__ import absolute_import + +__all__ = [ + 'WarningsCapture', +] + +import warnings + +import fixtures + + +class WarningsCapture(fixtures.Fixture): + """Capture warnings. + + While ``WarningsCapture`` is active, warnings will be captured by + the fixture (so that they can be later analyzed). + + :attribute captures: A list of warning capture ``WarningMessage`` objects. + """ + + def _showwarning(self, *args, **kwargs): + self.captures.append(warnings.WarningMessage(*args, **kwargs)) + + def setUp(self): + super(WarningsCapture, self).setUp() + patch = fixtures.MonkeyPatch("warnings.showwarning", self._showwarning) + self.useFixture(patch) + self.captures = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/tests/_fixtures/test_logger.py new/fixtures-1.2.0/fixtures/tests/_fixtures/test_logger.py --- old/fixtures-1.0.0/fixtures/tests/_fixtures/test_logger.py 2014-09-25 22:46:47.000000000 +0200 +++ new/fixtures-1.2.0/fixtures/tests/_fixtures/test_logger.py 2015-03-26 23:10:42.000000000 +0100 @@ -14,6 +14,7 @@ # limitations under that license. import logging +import sys import time from testtools import TestCase @@ -26,6 +27,19 @@ ) +# A simple custom formatter that prepends Foo to all log messages, for +# testing formatter overrides. +class FooFormatter(logging.Formatter): + def format(self, record): + # custom formatters interface changes in python 3.2 + if sys.version_info < (3, 2): + self._fmt = "Foo " + self._fmt + else: + self._style = logging.PercentStyle("Foo " + self._style._fmt) + self._fmt = self._style._fmt + return logging.Formatter.format(self, record) + + class FakeLoggerTest(TestCase, TestWithFixtures): def setUp(self): @@ -91,6 +105,16 @@ time.strftime("%Y test_logger\n", time.localtime()), fixture.output) + def test_custom_formatter(self): + fixture = FakeLogger(format="%(asctime)s %(module)s", + formatter=FooFormatter, + datefmt="%Y") + self.useFixture(fixture) + logging.info("message") + self.assertEqual( + time.strftime("Foo %Y test_logger\n", time.localtime()), + fixture.output) + def test_logging_output_included_in_details(self): fixture = FakeLogger() detail_name = "pythonlogging:''" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/tests/_fixtures/test_timeout.py new/fixtures-1.2.0/fixtures/tests/_fixtures/test_timeout.py --- old/fixtures-1.0.0/fixtures/tests/_fixtures/test_timeout.py 2014-09-25 04:31:06.000000000 +0200 +++ new/fixtures-1.2.0/fixtures/tests/_fixtures/test_timeout.py 2015-03-26 23:23:45.000000000 +0100 @@ -20,6 +20,7 @@ from testtools.testcase import ( TestSkipped, ) +from testtools.matchers import raises import fixtures @@ -57,10 +58,9 @@ self.requireUnix() # This will normally kill the whole process, which would be # inconvenient. Let's hook the alarm here so we can observe it. - self.got_alarm = False + class GotAlarm(Exception):pass def sigalrm_handler(signum, frame): - self.got_alarm = True + raise GotAlarm() old_handler = signal.signal(signal.SIGALRM, sigalrm_handler) self.addCleanup(signal.signal, signal.SIGALRM, old_handler) - sample_long_delay_with_harsh_timeout() - self.assertTrue(self.got_alarm) + self.assertThat(sample_long_delay_with_harsh_timeout, raises(GotAlarm)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures/tests/_fixtures/test_warnings.py new/fixtures-1.2.0/fixtures/tests/_fixtures/test_warnings.py --- old/fixtures-1.0.0/fixtures/tests/_fixtures/test_warnings.py 1970-01-01 01:00:00.000000000 +0100 +++ new/fixtures-1.2.0/fixtures/tests/_fixtures/test_warnings.py 2015-05-04 23:49:57.000000000 +0200 @@ -0,0 +1,49 @@ +# fixtures: Fixtures with cleanups for testing and convenience. +# +# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause +# license at the users choice. A copy of both licenses are available in the +# project source as Apache-2.0 and BSD. You may not use this file except in +# compliance with one of these two licences. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# license you chose for the specific language governing permissions and +# limitations under that license. + +import warnings + +import testtools + +import fixtures + + +class TestWarnings(testtools.TestCase, fixtures.TestWithFixtures): + + def test_capture_reuse(self): + w = fixtures.WarningsCapture() + with w: + warnings.warn("test", DeprecationWarning) + self.assertEqual(1, len(w.captures)) + with w: + self.assertEqual([], w.captures) + + def test_capture_message(self): + w = self.useFixture(fixtures.WarningsCapture()) + warnings.warn("hi", DeprecationWarning) + self.assertEqual(1, len(w.captures)) + self.assertEqual("hi", str(w.captures[0].message)) + + def test_capture_category(self): + w = self.useFixture(fixtures.WarningsCapture()) + categories = [ + DeprecationWarning, Warning, UserWarning, + SyntaxWarning, RuntimeWarning, + UnicodeWarning, FutureWarning, + ] + for category in categories: + warnings.warn("test", category) + self.assertEqual(len(categories), len(w.captures)) + for i, category in enumerate(categories): + c = w.captures[i] + self.assertEqual(category, c.category) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures.egg-info/PKG-INFO new/fixtures-1.2.0/fixtures.egg-info/PKG-INFO --- old/fixtures-1.0.0/fixtures.egg-info/PKG-INFO 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/fixtures.egg-info/PKG-INFO 2015-05-05 00:14:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: fixtures -Version: 1.0.0 +Version: 1.2.0 Summary: Fixtures, reusable state for writing clean tests and more. Home-page: https://launchpad.net/python-fixtures Author: Robert Collins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures.egg-info/SOURCES.txt new/fixtures-1.2.0/fixtures.egg-info/SOURCES.txt --- old/fixtures-1.0.0/fixtures.egg-info/SOURCES.txt 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/fixtures.egg-info/SOURCES.txt 2015-05-05 00:14:19.000000000 +0200 @@ -13,6 +13,7 @@ requirements.txt setup.cfg setup.py +tox.ini fixtures/__init__.py fixtures/callmany.py fixtures/fixture.py @@ -21,6 +22,7 @@ fixtures.egg-info/SOURCES.txt fixtures.egg-info/dependency_links.txt fixtures.egg-info/not-zip-safe +fixtures.egg-info/pbr.json fixtures.egg-info/requires.txt fixtures.egg-info/top_level.txt fixtures/_fixtures/__init__.py @@ -35,6 +37,7 @@ fixtures/_fixtures/tempdir.py fixtures/_fixtures/temphomedir.py fixtures/_fixtures/timeout.py +fixtures/_fixtures/warnings.py fixtures/tests/__init__.py fixtures/tests/helpers.py fixtures/tests/test_callmany.py @@ -51,4 +54,5 @@ fixtures/tests/_fixtures/test_streams.py fixtures/tests/_fixtures/test_tempdir.py fixtures/tests/_fixtures/test_temphomedir.py -fixtures/tests/_fixtures/test_timeout.py \ No newline at end of file +fixtures/tests/_fixtures/test_timeout.py +fixtures/tests/_fixtures/test_warnings.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures.egg-info/pbr.json new/fixtures-1.2.0/fixtures.egg-info/pbr.json --- old/fixtures-1.0.0/fixtures.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 +++ new/fixtures-1.2.0/fixtures.egg-info/pbr.json 2015-05-05 00:14:19.000000000 +0200 @@ -0,0 +1 @@ +{"is_release": true, "git_version": "f7502e8"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/fixtures.egg-info/requires.txt new/fixtures-1.2.0/fixtures.egg-info/requires.txt --- old/fixtures-1.0.0/fixtures.egg-info/requires.txt 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/fixtures.egg-info/requires.txt 2015-05-05 00:14:19.000000000 +0200 @@ -1 +1,2 @@ -testtools>=0.9.22 \ No newline at end of file +pbr>=0.11 +testtools>=0.9.22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/requirements.txt new/fixtures-1.2.0/requirements.txt --- old/fixtures-1.0.0/requirements.txt 2014-09-25 04:38:09.000000000 +0200 +++ new/fixtures-1.2.0/requirements.txt 2015-05-04 06:04:12.000000000 +0200 @@ -1 +1,2 @@ +pbr>=0.11 testtools>=0.9.22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/setup.cfg new/fixtures-1.2.0/setup.cfg --- old/fixtures-1.0.0/setup.cfg 2014-10-27 21:27:47.000000000 +0100 +++ new/fixtures-1.2.0/setup.cfg 2015-05-05 00:14:19.000000000 +0200 @@ -21,6 +21,9 @@ packages = fixtures +[bdist_wheel] +universal = 1 + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-1.0.0/tox.ini new/fixtures-1.2.0/tox.ini --- old/fixtures-1.0.0/tox.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/fixtures-1.2.0/tox.ini 2015-03-26 23:30:26.000000000 +0100 @@ -0,0 +1,12 @@ +[tox] +envlist = py27 +minversion = 1.6 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = VIRTUAL_ENV={envdir} +whitelist_externals = make +deps = -r{toxinidir}/requirements.txt +commands = make check