Hello community, here is the log from the commit of package python-MiniMock for openSUSE:Factory checked in at 2013-05-03 13:45:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-MiniMock (Old) and /work/SRC/openSUSE:Factory/.python-MiniMock.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-MiniMock" Changes: -------- --- /work/SRC/openSUSE:Factory/python-MiniMock/python-MiniMock.changes 2012-08-23 16:06:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-MiniMock.new/python-MiniMock.changes 2013-05-03 13:45:39.000000000 +0200 @@ -1,0 +2,11 @@ +Fri May 3 09:26:17 UTC 2013 - [email protected] + +- Fixed the obsoletes to '<' after last version update + +------------------------------------------------------------------- +Mon Apr 29 12:29:43 UTC 2013 - [email protected] + +- Update to 1.2.8: + * add python 3.x support + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/python-MiniMock/python3-MiniMock.changes 2012-12-03 11:27:17.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-MiniMock.new/python3-MiniMock.changes 2013-05-03 13:45:39.000000000 +0200 @@ -1,0 +2,17 @@ +Fri May 3 09:27:12 UTC 2013 - [email protected] + +- Provides/obsoletes for python3-minimock is useless, that package + never existed +- Removing __pycache__ is actually wrong +- "-rm docs/.changelog.rst.un~ # Remove junk" was bogus +- No need to buildrequire python3, usually you only need that when + requiring the _ssl module (as Jan if in doubt) +- No need to buildrequire python3-2to3, it's in python3-devel nowadays + +------------------------------------------------------------------- +Mon Apr 29 12:29:43 UTC 2013 - [email protected] + +- Update to 1.2.8: + * add python 3.x support + +------------------------------------------------------------------- Old: ---- MiniMock-1.2.7.tar.gz New: ---- MiniMock-1.2.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-MiniMock.spec ++++++ --- /var/tmp/diff_new_pack.qgvTm3/_old 2013-05-03 13:45:40.000000000 +0200 +++ /var/tmp/diff_new_pack.qgvTm3/_new 2013-05-03 13:45:40.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-MiniMock # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,9 @@ # - Name: python-MiniMock -Version: 1.2.7 -Release: 1 +Version: 1.2.8 +Release: 0 Url: http://pypi.python.org/pypi/MiniMock Summary: The simplest possible mock library License: MIT @@ -28,16 +27,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel BuildRequires: python-distribute -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +Provides: python-minimock = %{version} +Obsoletes: python-minimock < %{version} +%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%else BuildArch: noarch %endif -%endif -Provides: python-minimock = %{version} -#TODO: Change back to '<' after version update: -Obsoletes: python-minimock <= %{version} -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %description Minimock is a simple library for doing Mock objects with doctest. @@ -45,7 +41,6 @@ %prep %setup -q -n MiniMock-%{version} -rm docs/.changelog.rst.un~ # Remove junk %build python setup.py build @@ -55,7 +50,7 @@ %files %defattr(-,root,root,-) -%doc docs/* +%doc docs/license.txt %{python_sitelib}/minimock.py* %{python_sitelib}/MiniMock-%{version}-py%{py_ver}.egg-info ++++++ python3-MiniMock.spec ++++++ --- /var/tmp/diff_new_pack.qgvTm3/_old 2013-05-03 13:45:40.000000000 +0200 +++ /var/tmp/diff_new_pack.qgvTm3/_new 2013-05-03 13:45:40.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python3-MiniMock # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,24 +16,17 @@ # - Name: python3-MiniMock -Version: 1.2.7 -Release: 1 +Version: 1.2.8 +Release: 0 Url: http://pypi.python.org/pypi/MiniMock Summary: The simplest possible mock library License: MIT Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/M/MiniMock/MiniMock-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python3 BuildRequires: python3-devel -BuildRequires: python3-2to3 BuildRequires: python3-distribute -Provides: python3-minimock = %{version} -#TODO: Change back to '<' after version update: -Obsoletes: python3-minimock <= %{version} -Requires: python(abi) = %{py3_ver} BuildArch: noarch %description @@ -42,22 +35,17 @@ %prep %setup -q -n MiniMock-%{version} -rm docs/.changelog.rst.un~ # Remove junk +2to3 -w -n . %build -2to3 -w -n . python3 setup.py build %install python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} -if [ -d "%{buildroot}%{python3_sitelib}/__pycache__" ]; then - rm -r %{buildroot}%{python3_sitelib}/__pycache__ -fi %files %defattr(-,root,root,-) -%doc docs/* -%{python3_sitelib}/minimock.py* -%{python3_sitelib}/MiniMock-%{version}-py%{py3_ver}.egg-info +%doc docs/license.txt +%{python3_sitelib}/* %changelog ++++++ MiniMock-1.2.7.tar.gz -> MiniMock-1.2.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/MiniMock.egg-info/PKG-INFO new/MiniMock-1.2.8/MiniMock.egg-info/PKG-INFO --- old/MiniMock-1.2.7/MiniMock.egg-info/PKG-INFO 2011-08-19 17:25:00.000000000 +0200 +++ new/MiniMock-1.2.8/MiniMock.egg-info/PKG-INFO 2013-03-19 16:46:30.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 1.0 Name: MiniMock -Version: 1.2.7 +Version: 1.2.8 Summary: The simplest possible mock library Home-page: http://pypi.python.org/pypi/MiniMock -Author: Ian Bicking -Author-email: [email protected] +Author: Josh Bronson +Author-email: [email protected] License: MIT Description: MiniMock ======== @@ -51,6 +51,7 @@ Now we want to make a mock ``smtplib.SMTP`` object. We'll have to inject our mock into the ``smtplib`` module:: + >>> from minimock import Mock >>> smtplib.SMTP = Mock('smtplib.SMTP') >>> smtplib.SMTP.mock_returns = Mock('smtp_connection') @@ -158,6 +159,10 @@ News ---- + 1.2.8 + ----- + * python3 (+ tox) support! (Marc Abramowitz) + 1.2.7 ----- * Fix for mocking proxy objects. Worked in 1.2.5 but broken in 1.2.6 by the @@ -234,3 +239,9 @@ Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: MIT License Classifier: Topic :: Software Development :: Testing +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.5 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/MiniMock.egg-info/SOURCES.txt new/MiniMock-1.2.8/MiniMock.egg-info/SOURCES.txt --- old/MiniMock-1.2.7/MiniMock.egg-info/SOURCES.txt 2011-08-19 17:25:00.000000000 +0200 +++ new/MiniMock-1.2.8/MiniMock.egg-info/SOURCES.txt 2013-03-19 16:46:30.000000000 +0100 @@ -7,7 +7,6 @@ MiniMock.egg-info/dependency_links.txt MiniMock.egg-info/top_level.txt MiniMock.egg-info/zip-safe -docs/.changelog.rst.un~ docs/changelog.rst docs/index.rst docs/license.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/PKG-INFO new/MiniMock-1.2.8/PKG-INFO --- old/MiniMock-1.2.7/PKG-INFO 2011-08-19 17:25:00.000000000 +0200 +++ new/MiniMock-1.2.8/PKG-INFO 2013-03-19 16:46:30.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 1.0 Name: MiniMock -Version: 1.2.7 +Version: 1.2.8 Summary: The simplest possible mock library Home-page: http://pypi.python.org/pypi/MiniMock -Author: Ian Bicking -Author-email: [email protected] +Author: Josh Bronson +Author-email: [email protected] License: MIT Description: MiniMock ======== @@ -51,6 +51,7 @@ Now we want to make a mock ``smtplib.SMTP`` object. We'll have to inject our mock into the ``smtplib`` module:: + >>> from minimock import Mock >>> smtplib.SMTP = Mock('smtplib.SMTP') >>> smtplib.SMTP.mock_returns = Mock('smtp_connection') @@ -158,6 +159,10 @@ News ---- + 1.2.8 + ----- + * python3 (+ tox) support! (Marc Abramowitz) + 1.2.7 ----- * Fix for mocking proxy objects. Worked in 1.2.5 but broken in 1.2.6 by the @@ -234,3 +239,9 @@ Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: MIT License Classifier: Topic :: Software Development :: Testing +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.5 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 Files old/MiniMock-1.2.7/docs/.changelog.rst.un~ and new/MiniMock-1.2.8/docs/.changelog.rst.un~ differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/docs/changelog.rst new/MiniMock-1.2.8/docs/changelog.rst --- old/MiniMock-1.2.7/docs/changelog.rst 2011-08-19 17:22:05.000000000 +0200 +++ new/MiniMock-1.2.8/docs/changelog.rst 2013-03-19 16:35:38.000000000 +0100 @@ -2,6 +2,10 @@ News ---- +1.2.8 +----- +* python3 (+ tox) support! (Marc Abramowitz) + 1.2.7 ----- * Fix for mocking proxy objects. Worked in 1.2.5 but broken in 1.2.6 by the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/docs/index.rst new/MiniMock-1.2.8/docs/index.rst --- old/MiniMock-1.2.7/docs/index.rst 2009-11-29 18:06:17.000000000 +0100 +++ new/MiniMock-1.2.8/docs/index.rst 2013-03-19 16:26:11.000000000 +0100 @@ -43,6 +43,7 @@ Now we want to make a mock ``smtplib.SMTP`` object. We'll have to inject our mock into the ``smtplib`` module:: + >>> from minimock import Mock >>> smtplib.SMTP = Mock('smtplib.SMTP') >>> smtplib.SMTP.mock_returns = Mock('smtp_connection') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/minimock.py new/MiniMock-1.2.8/minimock.py --- old/MiniMock-1.2.7/minimock.py 2011-07-19 20:04:43.000000000 +0200 +++ new/MiniMock-1.2.8/minimock.py 2013-03-19 16:26:11.000000000 +0100 @@ -40,16 +40,30 @@ __all__ = ["mock", "restore", "Mock", "TraceTracker", "assert_same_trace"] -import __builtin__ import sys import inspect import doctest import re import textwrap + try: - from cStringIO import StringIO + import builtins except ImportError: - from StringIO import StringIO + # python < 3 + import __builtin__ as builtins + try: + from cStringIO import StringIO + except ImportError: + from StringIO import StringIO +else: + # python 3 + from io import StringIO +try: + next +except NameError: + # python < 2.6 + def next(x): + return x.next() # A list of mocked objects. Each item is a tuple of (original object, # namespace dict, object name, and a list of object attributes). @@ -69,7 +83,7 @@ ... (locals(),)) >>> obj_name, attrs ('os', ['path', 'isdir']) - >>> getattr(getattr(nsdict[obj_name], attrs[0]), attrs[1]) + >>> getattr(getattr(nsdict[obj_name], attrs[0]), attrs[1]) # doctest: +ELLIPSIS <function isdir at ...> >>> lookup_by_name("os.monkey", (locals(),)) Traceback (most recent call last): @@ -111,11 +125,11 @@ An example of how os.path.isfile is replaced:: >>> import os - >>> os.path.isfile + >>> os.path.isfile # doctest: +ELLIPSIS <function isfile at ...> >>> isfile_id = id(os.path.isfile) >>> mock("os.path.isfile", returns=True) - >>> os.path.isfile + >>> os.path.isfile # doctest: +ELLIPSIS <Mock ... os.path.isfile> >>> os.path.isfile("/foo/bar/baz") Called os.path.isfile('/foo/bar/baz') @@ -131,16 +145,20 @@ >>> mock_id != id(os.path.isfile) True >>> restore() - >>> os.path.isfile + >>> os.path.isfile # doctest: +ELLIPSIS <function isfile at ...> >>> isfile_id == id(os.path.isfile) True Test mocking a built-in function:: - >>> mock("raw_input", returns="okay") - >>> raw_input() - Called raw_input() + >>> try: + ... input = raw_input + ... except NameError: + ... pass # for Python 3 + >>> mock("input", returns="okay") + >>> input() + Called input() 'okay' >>> restore() @@ -176,10 +194,10 @@ ... return getattr(self._obj, name) >>> import os >>> os = Proxy(os) - >>> os.path.isfile + >>> os.path.isfile # doctest: +ELLIPSIS <function isfile at ...> >>> mock('os.path.isfile') - >>> os.path.isfile + >>> os.path.isfile # doctest: +ELLIPSIS <Mock ... os.path.isfile> >>> restore() @@ -190,7 +208,7 @@ # stack[1][0] is the frame object of the caller to this function globals_ = stack[1][0].f_globals locals_ = stack[1][0].f_locals - nsdicts = (locals_, globals_, __builtin__.__dict__) + nsdicts = (locals_, globals_, builtins.__dict__) finally: del(stack) @@ -208,7 +226,7 @@ # because if tmp is itself a mock object, tmp.func_globals will # return another mock object if isinstance(getattr(tmp, 'func_globals', None), dict): - nsdict = tmp.func_globals + nsdict = tmp.__globals__ if not attrs: original = tmp nsdict[obj_name] = mock_obj @@ -264,7 +282,7 @@ >>> m.some_meth('dummy argument') >>> assert_same_trace(tt, ... "Called mock_obj.some_meth('dummy argument')\n") - >>> assert_same_trace(tt, "Non-matching trace") + >>> assert_same_trace(tt, "Non-matching trace") # doctest: +ELLIPSIS Traceback (most recent call last): ... AssertionError... @@ -292,11 +310,11 @@ parts = [repr(a) for a in args] parts.extend( '%s=%r' % (items) for items in sorted(kw.items())) - msg = 'Called %s(%s)' % (func_name, ', '.join(parts)) + msg = 'Called %s(%s)\n' % (func_name, ', '.join(parts)) if len(msg) > 80: - msg = 'Called %s(\n %s)' % ( + msg = 'Called %s(\n %s)\n' % ( func_name, ',\n '.join(parts)) - print >> self.file, msg + self.file.write(msg) def set(self, obj_name, attr, value): """ @@ -304,7 +322,7 @@ >>> z.a = 2 Set z.a = 2 """ - print >> self.file, 'Set %s.%s = %r' % (obj_name, attr, value) + self.file.write('Set %s.%s = %r\n' % (obj_name, attr, value)) class TraceTracker(Printer): """ @@ -391,8 +409,13 @@ def clear(self): """Clear the MiniMock object usage that has been tracked so far. + + truncate() was modified not to change the file position anymore + in Python 3.1.2, so should be sought explicitly. + http://bugs.python.org/issue8558 """ self.out.truncate(0) + self.out.seek(0) def normalize_function_parameters(text): @@ -505,7 +528,7 @@ return self.mock_returns elif self.mock_returns_iter is not None: try: - return self.mock_returns_iter.next() + return next(self.mock_returns_iter) except StopIteration: raise Exception("No more mock return values are present.") elif self.mock_returns_func is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MiniMock-1.2.7/setup.py new/MiniMock-1.2.8/setup.py --- old/MiniMock-1.2.7/setup.py 2011-08-19 17:22:24.000000000 +0200 +++ new/MiniMock-1.2.8/setup.py 2013-03-19 16:30:18.000000000 +0100 @@ -1,6 +1,6 @@ from setuptools import setup -version = '1.2.7' +version = '1.2.8' try: from os.path import join, dirname @@ -20,10 +20,18 @@ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.5", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", ], keywords='mock testing unittest', author='Ian Bicking', author_email='[email protected]', + maintainer='Josh Bronson', + maintainer_email='[email protected]', url='http://pypi.python.org/pypi/MiniMock', license='MIT', py_modules=['minimock'], -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
