Hello community, here is the log from the commit of package python-fixtures for openSUSE:Factory checked in at 2013-09-16 16:31:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2013-01-14 22:25:10.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-fixtures.new/python-fixtures.changes 2013-09-16 16:31:56.000000000 +0200 @@ -1,0 +2,12 @@ +Wed Sep 4 13:15:26 UTC 2013 - [email protected] + +- Update to version 0.3.14 + + FakePopen can now override the returncode attribute. +- Changes from version 0.3.13: + + Documentation hopefully covers TestWithFixtures a little better. + + FakePopen now accepts all the parameters available in Python 2.7. + + FakePopen now only passes parameters to the get_info routine if the + caller supplied them. + + setup.py now lists the testtools dependency which was missing. + +------------------------------------------------------------------- Old: ---- fixtures-0.3.12.tar.gz New: ---- fixtures-0.3.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-fixtures.spec ++++++ --- /var/tmp/diff_new_pack.5tJcRq/_old 2013-09-16 16:31:56.000000000 +0200 +++ /var/tmp/diff_new_pack.5tJcRq/_new 2013-09-16 16:31:56.000000000 +0200 @@ -13,15 +13,16 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Name: python-fixtures -Version: 0.3.12 +Version: 0.3.14 Release: 0 -License: Apache-2.0 and BSD-3-Clause Summary: Fixtures, reusable state for writing clean tests and more -Url: https://launchpad.net/python-fixtures +License: Apache-2.0 and BSD-3-Clause Group: Development/Languages/Python +Url: https://launchpad.net/python-fixtures Source: http://pypi.python.org/packages/source/f/fixtures/fixtures-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-testtools >= 0.9.22 ++++++ fixtures-0.3.12.tar.gz -> fixtures-0.3.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/.bzrignore new/fixtures-0.3.14/.bzrignore --- old/fixtures-0.3.12/.bzrignore 2011-11-22 09:25:03.000000000 +0100 +++ new/fixtures-0.3.14/.bzrignore 2013-08-16 02:45:03.000000000 +0200 @@ -5,3 +5,4 @@ dist .testrepository __pycache__ +fixtures.egg-info diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/HACKING new/fixtures-0.3.14/HACKING --- old/fixtures-0.3.12/HACKING 2010-08-15 08:04:29.000000000 +0200 +++ new/fixtures-0.3.14/HACKING 2013-08-16 02:56:10.000000000 +0200 @@ -35,3 +35,17 @@ more specific modules, rather than becoming large and bloated itself. For instance, TestWithFixtures lives in fixtures.testcase, and is imported in the fixtures __init__.py. + +Releasing ++++++++++ + +1. Update the version number in __init__.py and setup.py and add a version to + NEWS. + +1. Upload to pypi, signed. + +1. commit, tag. + +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-0.3.12/NEWS new/fixtures-0.3.14/NEWS --- old/fixtures-0.3.12/NEWS 2012-12-17 01:34:25.000000000 +0100 +++ new/fixtures-0.3.14/NEWS 2013-08-16 05:03:21.000000000 +0200 @@ -6,6 +6,33 @@ NEXT ~~~~ +0.3.14 +~~~~~~ + +CHANGES +------- + +* ``FakePopen`` can now override the returncode attribute. + (Robert Collins) + +0.3.13 +~~~~~~ + +CHANGES +------- + +* Documentation hopefully covers ``TestWithFixtures`` a little better. + (Robert Collins, #1102688) + +* ``FakePopen`` now accepts all the parameters available in Python 2.7. + (Robert Collins) + +* ``FakePopen`` now only passes parameters to the get_info routine if the + caller supplied them. (Robert Collins) + +* ``setup.py`` now lists the ``testtools`` dependency which was missing. + (Robert Collins, #1103823) + 0.3.12 ~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/PKG-INFO new/fixtures-0.3.14/PKG-INFO --- old/fixtures-0.3.12/PKG-INFO 2012-12-17 01:35:55.000000000 +0100 +++ new/fixtures-0.3.14/PKG-INFO 2013-08-16 05:04:44.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: fixtures -Version: 0.3.12 +Version: 0.3.14 Summary: Fixtures, reusable state for writing clean tests and more. Home-page: https://launchpad.net/python-fixtures Author: Robert Collins @@ -181,7 +181,10 @@ >>> import unittest Note that we use testtools TestCase here as we need to guarantee a - TestCase.addCleanup method. + TestCase.addCleanup method in this doctest. Unittest2 - Python2.7 and above - + also have ``addCleanup``. testtools has it's own implementation of + ``useFixture`` so there is no need to use ``fixtures.TestWithFixtures`` with + ``testtools.TestCase``. >>> class NoddyTest(testtools.TestCase, fixtures.TestWithFixtures): ... def test_example(self): @@ -452,3 +455,4 @@ Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Software Development :: Quality Assurance Classifier: Topic :: Software Development :: Testing +Requires: testtools diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/README new/fixtures-0.3.14/README --- old/fixtures-0.3.12/README 2012-12-17 00:30:32.000000000 +0100 +++ new/fixtures-0.3.14/README 2013-08-16 02:48:54.000000000 +0200 @@ -173,7 +173,10 @@ >>> import unittest Note that we use testtools TestCase here as we need to guarantee a -TestCase.addCleanup method. +TestCase.addCleanup method in this doctest. Unittest2 - Python2.7 and above - +also have ``addCleanup``. testtools has it's own implementation of +``useFixture`` so there is no need to use ``fixtures.TestWithFixtures`` with +``testtools.TestCase``. >>> class NoddyTest(testtools.TestCase, fixtures.TestWithFixtures): ... def test_example(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/lib/fixtures/__init__.py new/fixtures-0.3.14/lib/fixtures/__init__.py --- old/fixtures-0.3.12/lib/fixtures/__init__.py 2012-12-17 01:33:57.000000000 +0100 +++ new/fixtures-0.3.14/lib/fixtures/__init__.py 2013-08-16 05:03:41.000000000 +0200 @@ -36,7 +36,7 @@ # 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). -__version__ = (0, 3, 12, 'final', 0) +__version__ = (0, 3, 14, 'final', 0) __all__ = [ 'ByteStream', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/lib/fixtures/_fixtures/popen.py new/fixtures-0.3.14/lib/fixtures/_fixtures/popen.py --- old/fixtures-0.3.12/lib/fixtures/_fixtures/popen.py 2011-12-05 06:11:42.000000000 +0100 +++ new/fixtures-0.3.14/lib/fixtures/_fixtures/popen.py 2013-08-16 04:59:09.000000000 +0200 @@ -33,10 +33,11 @@ self.stdout = info.get('stdout') self.stderr = info.get('stderr') self.pid = random.randint(0, 65536) + self._returncode = info.get('returncode', 0) self.returncode = None def communicate(self): - self.returncode = 0 + self.returncode = self._returncode if self.stdout: out = self.stdout.getvalue() else: @@ -48,6 +49,8 @@ return out, err def wait(self): + if self.returncode is None: + self.communicate() return self.returncode @@ -60,13 +63,25 @@ :ivar procs: A list of the processes created by the fixture. """ + _unpassed = object() + def __init__(self, get_info=lambda _:{}): """Create a PopenFixture :param get_info: Optional callback to control the behaviour of the created process. This callback takes a kwargs dict for the Popen call, and should return a dict with any desired attributes. - e.g. return {'stdin': StringIO('foobar')} + Only parameters that are supplied to the Popen call are in the + dict, making it possible to detect the difference between 'passed + with a default value' and 'not passed at all'. + + e.g. + def get_info(proc_args): + self.assertEqual(subprocess.PIPE, proc_args['stdin']) + return {'stdin': StringIO('foobar')} + + The default behaviour if no get_info is supplied is for the return + process to have returncode of None, empty streams and a random pid. """ super(FakePopen, self).__init__() self.get_info = get_info @@ -77,10 +92,21 @@ subprocess.Popen = self self.procs = [] - def __call__(self, args, bufsize=0, executable=None, stdin=None, - stdout=None, stderr=None): - proc_args = dict(args=args, bufsize=bufsize, executable=executable, - stdin=stdin, stdout=stdout, stderr=stderr) + # The method has the correct signature so we error appropriately if called + # wrongly. + def __call__(self, args, bufsize=_unpassed, executable=_unpassed, + stdin=_unpassed, stdout=_unpassed, stderr=_unpassed, + preexec_fn=_unpassed, close_fds=_unpassed, shell=_unpassed, + cwd=_unpassed, env=_unpassed, universal_newlines=_unpassed, + startupinfo=_unpassed, creationflags=_unpassed): + proc_args = dict(args=args) + local = locals() + for param in [ + "bufsize", "executable", "stdin", "stdout", "stderr", + "preexec_fn", "close_fds", "shell", "cwd", "env", + "universal_newlines", "startupinfo", "creationflags"]: + if local[param] is not FakePopen._unpassed: + proc_args[param] = local[param] proc_info = self.get_info(proc_args) result = FakeProcess(proc_args, proc_info) self.procs.append(result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/lib/fixtures/testcase.py new/fixtures-0.3.14/lib/fixtures/testcase.py --- old/fixtures-0.3.12/lib/fixtures/testcase.py 2011-12-05 06:11:42.000000000 +0100 +++ new/fixtures-0.3.14/lib/fixtures/testcase.py 2013-08-16 02:50:11.000000000 +0200 @@ -26,6 +26,9 @@ """A TestCase with a helper function to use fixtures. Normally used as a mix-in class to add useFixture. + + Note that test classes such as testtools.TestCase which already have a + ``useFixture`` method do not need this mixed in. """ def useFixture(self, fixture): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/lib/fixtures/tests/_fixtures/test_popen.py new/fixtures-0.3.14/lib/fixtures/tests/_fixtures/test_popen.py --- old/fixtures-0.3.12/lib/fixtures/tests/_fixtures/test_popen.py 2011-12-05 06:11:42.000000000 +0100 +++ new/fixtures-0.3.14/lib/fixtures/tests/_fixtures/test_popen.py 2013-08-16 05:03:01.000000000 +0200 @@ -51,6 +51,27 @@ proc = fixture(['foo']) self.assertEqual('stdout', proc.stdout) + def test_handles_all_2_7_args(self): + all_args = dict( + args="args", bufsize="bufsize", executable="executable", + stdin="stdin", stdout="stdout", stderr="stderr", + preexec_fn="preexec_fn", close_fds="close_fds", shell="shell", + cwd="cwd", env="env", universal_newlines="universal_newlines", + startupinfo="startupinfo", creationflags="creationflags") + def get_info(proc_args): + self.assertEqual(all_args, proc_args) + return {} + fixture = self.useFixture(FakePopen(get_info)) + proc = fixture(**all_args) + + def test_custom_returncode(self): + def get_info(proc_args): + return dict(returncode=1) + proc = self.useFixture(FakePopen(get_info))(['foo']) + self.assertEqual(None, proc.returncode) + self.assertEqual(1, proc.wait()) + self.assertEqual(1, proc.returncode) + class TestFakeProcess(testtools.TestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fixtures-0.3.12/setup.py new/fixtures-0.3.14/setup.py --- old/fixtures-0.3.12/setup.py 2012-12-17 01:27:13.000000000 +0100 +++ new/fixtures-0.3.14/setup.py 2013-08-16 05:04:31.000000000 +0200 @@ -6,7 +6,7 @@ description = open(os.path.join(os.path.dirname(__file__), 'README'), 'rt').read() setup(name="fixtures", - version="0.3.12", + version="0.3.14", description="Fixtures, reusable state for writing clean tests and more.", keywords="fixture fixtures unittest contextmanager", long_description=description, @@ -27,4 +27,7 @@ 'Topic :: Software Development :: Quality Assurance', 'Topic :: Software Development :: Testing', ], + requires = [ + 'testtools', + ], ) -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
