![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package python3-case for openSUSE:Factory checked in at 2016-10-28 10:47:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-case (Old) and /work/SRC/openSUSE:Factory/.python3-case.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-case" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-case/python3-case.changes 2016-07-15 12:53:50.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-case.new/python3-case.changes 2016-10-28 10:47:37.000000000 +0200 @@ -1,0 +2,21 @@ +Thu Oct 27 15:49:21 UTC 2016 - arun@gmx.de + +- update to version 1.4.0: + * Adds new helper: "case.pytest.fixture_with_options". + +- changes from version 1.3.1: + * All case decorators now works with py.test classes. + * Py.test: Adds new `stdouts` fixture that patches + :data:`sys.stdout`, and :data:`sys.stderr`. + * Py.test: The `patching` fixture can now mock modules. + +- changes from version 1.3.0: + * Case is now a py.test plug-in and provides a `patching` fixture as + a shortcut to `monkeypatch` setting the value to a mock. This + does not have any effects for users not using py.test. + +- changes from version 1.2.3: + * Case decorators now supports py.test. + * Patcher created by create_patcher now accepts *args. + +------------------------------------------------------------------- Old: ---- case-1.2.2.tar.gz New: ---- case-1.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-case.spec ++++++ --- /var/tmp/diff_new_pack.sBNuXq/_old 2016-10-28 10:47:38.000000000 +0200 +++ /var/tmp/diff_new_pack.sBNuXq/_new 2016-10-28 10:47:38.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-case -Version: 1.2.2 +Version: 1.4.0 Release: 0 Summary: Python unittest Utilities License: BSD-3-Clause ++++++ case-1.2.2.tar.gz -> case-1.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/Changelog new/case-1.4.0/Changelog --- old/case-1.2.2/Changelog 2016-06-23 23:47:06.000000000 +0200 +++ new/case-1.4.0/Changelog 2016-10-18 03:54:35.000000000 +0200 @@ -1,11 +1,112 @@ Changes ======= +.. _version-1.4.0: + +1.4.0 +===== +:release-date: 2016-10-17 06:14 p.m. PDT +:release-by: Ask Solem + +- Adds new helper: ``case.pytest.fixture_with_options``. + + Example: + + .. code-block:: python + + @fixture_with_options() + def sftp(request, + username='test_username', + password='test_password'): + return {'username': username, 'password': password} + + @sftp.options(username='foo', password='bar') + def test_foo(sftp): + assert sftp['username'] == 'foo' + assert sftp['password'] == 'bar' + +.. _version-1.3.1: + +1.3.1 +===== +:release-date: 2016-07-22 06:14 p.m. PDT +:release-by: Ask Solem + +- All case decorators now works with py.test classes. + +- Py.test: Adds new `stdouts` fixture that patches :data:`sys.stdout`, + and :data:`sys.stderr`. + + Example: + + .. code-block:: python + + def test_x(stdouts): + print('foo') + assert 'foo' in stdouts.stdout.getvalue() + print('bar', file=sys.stderr) + assert 'bar' in stdouts.stderr.getvalue() + +- Py.test: The `patching` fixture can now mock modules. + + Example: + + .. code-block:: python + + def test_x(patching): + gevent, gevent_monkey = patching.modules( + 'gevent', + 'gevent.monkey', + ) + os = patching.modules('os') + gevent_monkey.patch_all.side_effect = RuntimeError() + + with pytest.raises(RuntimeError): + from gevent import monkey + monkey.patch_all() + +.. _version-1.3.0: + +1.3.0 +===== +:release-date: 2016-07-18 05:33 p.m. PDT +:release-by: Ask Solem + +- Case is now a py.test plug-in and provides a `patching` fixture + as a shortcut to `monkeypatch` setting the value to a mock. + + This does not have any effects for users not using py.test. + + Example: + + .. code-block:: python + + def test_foo(patching): + # execv value here will be mock.MagicMock by default. + execv = patching('os.execv') + + patching('sys.platform', 'darwin') # set concrete value + patching.setenv('DJANGO_SETTINGS_MODULE', 'x.settings') + + # val will be of type mock.MagicMock by default + val = patching.setitem('path.to.dict', 'KEY') + +.. _version-1.2.3: + +1.2.3 +===== +:release-date: 2016-06-15 03:00 p.m. PDT +:release-by: Ask Solem + +- Case decorators now supports py.test. + +- Patcher created by create_patcher now accepts *args. + .. _version-1.2.2: 1.2.2 ===== -:release-date: 2016-06-23 02:46 P.M PDT +:release-date: 2016-06-23 02:46 p.m. PDT :release-by: Ask Solem - ``mock.reload_modules``: Fixed compatibility with Python 3. @@ -14,7 +115,7 @@ 1.2.1 ===== -:release-date: 2016-06-23 12:111 P.M PDT +:release-date: 2016-06-23 12:111 p.m. PDT :release-by: Ask Solem - ``mock.reload_modules`` now re-imports the module and @@ -27,7 +128,7 @@ 1.2.0 ===== -:release-date: 2016-06-13 05:00 P.M PDT +:release-date: 2016-06-13 05:00 p.m. PDT :release-by: Ask Solem - Adds ``mock.mute`` decorator to suppress stdout with no return value. @@ -43,7 +144,7 @@ 1.1.4 ===== -:release-date: 2016-05-12 03:04 P.M PDT +:release-date: 2016-05-12 03:04 p.m. PDT :release-by: Ask Solem - ``case.patch.*`` functions now supports using ``new`` as a positional @@ -53,7 +154,7 @@ 1.1.3 ===== -:release-date: 2016-04-19 04:41 P.M PDT +:release-date: 2016-04-19 04:41 p.m. PDT :release-by: Ask Solem - ``case.patch(autospec=True)`` now works. @@ -64,7 +165,7 @@ 1.1.2 ===== -:release-date: 2016-04-08 11:34 P.M PDT +:release-date: 2016-04-08 11:34 p.m. PDT :release-by: Ask Solem - Also :func:`case.patch.multiple`, and :func:`case.patch.object` @@ -74,7 +175,7 @@ 1.1.1 ===== -:release-date: 2016-04-08 11:13 P.M PDT +:release-date: 2016-04-08 11:13 p.m. PDT :release-by: Ask Solem - :func:`case.patch` now gives :class:`case.MagicMock` (not @@ -84,7 +185,7 @@ 1.1.0 ===== -:release-date: 2016-04-08 10:00 P.M PDT +:release-date: 2016-04-08 10:00 p.m. PDT :release-by: Ask Solem - Adds new Mock methods from Python 3.6: @@ -113,7 +214,7 @@ 1.0.3 ===== -:release-date: 2016-04-06 04:00 P.M PDT +:release-date: 2016-04-06 04:00 p.m. PDT :release-by: Ask Solem - Python 2.6 compatibility. @@ -124,7 +225,7 @@ 1.0.2 ===== -:release-date: 2016-04-06 03:46 P.M PDT +:release-date: 2016-04-06 03:46 p.m. PDT :release-by: Ask Solem - Adds docstrings @@ -133,7 +234,7 @@ 1.0.1 ===== -:release-date: 2016-04-05 04:00 P.M PDT +:release-date: 2016-04-05 04:00 p.m. PDT :release-by: Ask Solem - Fixed issues with Python 3 @@ -142,7 +243,7 @@ 1.0.0 ===== -:release-date: 2016-04-05 02:00 P.M PDT +:release-date: 2016-04-05 02:00 p.m. PDT :release-by: Ask Solem - Initial release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/PKG-INFO new/case-1.4.0/PKG-INFO --- old/case-1.2.2/PKG-INFO 2016-06-23 23:48:05.000000000 +0200 +++ new/case-1.4.0/PKG-INFO 2016-10-18 03:56:30.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: case -Version: 1.2.2 +Version: 1.4.0 Summary: Python unittest Utilities Home-page: http://github.com/celery/case Author: Ask Solem @@ -10,7 +10,9 @@ Python unittest utilities ===================================================================== - :Version: 1.2.2 + |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| + + :Version: 1.4.0 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ @@ -66,19 +68,31 @@ $ pip install https://github.com/celery/case/zipball/master#egg=case - .. image:: https://secure.travis-ci.org/celery/case.png?branch=master + .. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case - .. image:: https://codecov.io/github/celery/case/coverage.svg?branch=master + .. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master - .. image:: https://d2weczhvl823v0.cloudfront.net/celery/case/trend.png - :alt: Bitdeli badge - :target: https://bitdeli.com/free + .. |license| image:: https://img.shields.io/pypi/l/case.svg + :alt: BSD License + :target: https://opensource.org/licenses/BSD-3-Clause + + .. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg + :alt: Case can be installed via wheel + :target: http://pypi.python.org/pypi/case/ + + .. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg + :alt: Supported Python versions. + :target: http://pypi.python.org/pypi/case/ + .. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg + :alt: Support Python implementations. + :target: http://pypi.python.org/pypi/case/ +Keywords: test unit testing pytest unittest mock patch Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/README.rst new/case-1.4.0/README.rst --- old/case-1.2.2/README.rst 2016-06-23 23:47:14.000000000 +0200 +++ new/case-1.4.0/README.rst 2016-10-18 03:54:44.000000000 +0200 @@ -2,7 +2,9 @@ Python unittest utilities ===================================================================== -:Version: 1.2.2 +|build-status| |coverage| |license| |wheel| |pyversion| |pyimp| + +:Version: 1.4.0 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ @@ -58,15 +60,26 @@ $ pip install https://github.com/celery/case/zipball/master#egg=case -.. image:: https://secure.travis-ci.org/celery/case.png?branch=master +.. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case -.. image:: https://codecov.io/github/celery/case/coverage.svg?branch=master +.. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master -.. image:: https://d2weczhvl823v0.cloudfront.net/celery/case/trend.png - :alt: Bitdeli badge - :target: https://bitdeli.com/free - +.. |license| image:: https://img.shields.io/pypi/l/case.svg + :alt: BSD License + :target: https://opensource.org/licenses/BSD-3-Clause + +.. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg + :alt: Case can be installed via wheel + :target: http://pypi.python.org/pypi/case/ + +.. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg + :alt: Supported Python versions. + :target: http://pypi.python.org/pypi/case/ + +.. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg + :alt: Support Python implementations. + :target: http://pypi.python.org/pypi/case/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case/__init__.py new/case-1.4.0/case/__init__.py --- old/case-1.2.2/case/__init__.py 2016-06-23 23:47:21.000000000 +0200 +++ new/case-1.4.0/case/__init__.py 2016-10-18 03:54:44.000000000 +0200 @@ -1,14 +1,17 @@ """Python unittest Utilities""" from __future__ import absolute_import, unicode_literals +import re + +from collections import namedtuple + from .case import Case from .mock import ANY, ContextMock, MagicMock, Mock, call, patch, sentinel from . import mock from . import skip -VERSION = (1, 2, 2) -__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) +__version__ = '1.4.0' __author__ = 'Ask Solem' __contact__ = 'ask@celeryproject.org' __homepage__ = 'http://github.com/celery/case' @@ -16,6 +19,19 @@ # -eof meta- +version_info_t = namedtuple('version_info_t', ( + 'major', 'minor', 'micro', 'releaselevel', 'serial' +)) + +# bumpversion can only search for {current_version} +# so we have to parse the version here. +_temp = re.match( + r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups() +VERSION = version_info = version_info_t( + int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '') +del(_temp) +del(re) + __all__ = [ b'Case', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case/mock.py new/case-1.4.0/case/mock.py --- old/case-1.2.2/case/mock.py 2016-06-23 23:45:45.000000000 +0200 +++ new/case-1.4.0/case/mock.py 2016-10-18 03:56:06.000000000 +0200 @@ -54,8 +54,8 @@ def create_patcher(*partial_path): - def patcher(name, **kwargs): - return patch(".".join(partial_path + (name, )), **kwargs) + def patcher(name, *args, **kwargs): + return patch(".".join(partial_path + (name, )), *args, **kwargs) return patcher @@ -122,7 +122,7 @@ for key, value in items(attrs): setattr(self, key, value) - def assert_not_called(_mock_self): + def assert_not_called(_mock_self): # noqa """assert that the mock was never called.""" self = _mock_self if self.call_count != 0: @@ -130,7 +130,7 @@ (self._mock_name or 'mock', self.call_count)) raise AssertionError(msg) - def assert_called(_mock_self): + def assert_called(_mock_self): # noqa """assert that the mock was called at least once.""" self = _mock_self if self.call_count == 0: @@ -138,7 +138,7 @@ self._mock_name or 'mock') raise AssertionError(msg) - def assert_called_once(_mock_self): + def assert_called_once(_mock_self): # noqa """assert that the mock was called only once.""" self = _mock_self if not self.call_count == 1: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case/pytest.py new/case-1.4.0/case/pytest.py --- old/case-1.2.2/case/pytest.py 1970-01-01 01:00:00.000000000 +0100 +++ new/case-1.4.0/case/pytest.py 2016-09-30 20:58:36.000000000 +0200 @@ -0,0 +1,132 @@ +from __future__ import absolute_import, unicode_literals + +import pytest +import sys + +from functools import partial, wraps +from six import iteritems as items + +from . import mock + +sentinel = object() + + +class fixture_with_options(object): + """Pytest fixture with options specified in separate decrorator. + + The decorated fixture MUST take the request fixture as first argument, + but is free to use other fixtures. + + Example: + @fixture_with_options() + def sftp(request, + username='test_username', + password='test_password'): + return {'username': username, 'password': password} + + @sftp.options(username='foo', password='bar') + def test_foo(sftp): + assert sftp['username'] == 'foo' + assert sftp['password'] == 'bar' + """ + + def __init__(self, marker_name=None): + self.marker_name = marker_name + + def __call__(self, fun): + marker_name = self.marker_name or fun.__name__ + + @pytest.fixture() + @wraps(fun) + def _inner(request, *args, **kwargs): + marker = request.node.get_marker(marker_name) + return fun(request, *args, **dict(marker.kwargs, **kwargs)) + _inner.options = partial(getattr(pytest.mark, marker_name)) + _inner.__wrapped__ = fun + return _inner + + +class _patching(object): + + def __init__(self, monkeypatch, request): + self.monkeypatch = monkeypatch + self.request = request + + def __getattr__(self, name): + return getattr(self.monkeypatch, name) + + def __call__(self, path, value=sentinel, name=None, + new=mock.MagicMock, **kwargs): + value = self._value_or_mock(value, new, name, path, **kwargs) + self.monkeypatch.setattr(path, value) + return value + + def _value_or_mock(self, value, new, name, path, **kwargs): + if value is sentinel: + value = new(name=name or path.rpartition('.')[2]) + for k, v in items(kwargs): + setattr(value, k, v) + return value + + def setattr(self, target, name=sentinel, value=sentinel, **kwargs): + # alias to __call__ with the interface of pytest.monkeypatch.setattr + if value is sentinel: + value, name = name, None + return self(target, value, name=name) + + def setitem(self, dic, name, value=sentinel, new=mock.MagicMock, **kwargs): + # same as pytest.monkeypatch.setattr but default value is MagicMock + value = self._value_or_mock(value, new, name, dic, **kwargs) + self.monkeypatch.setitem(dic, name, value) + return value + + def modules(self, *mods): + modules = [] + for mod in mods: + mod = mod.split('.') + modules.extend(reversed([ + '.'.join(mod[:-i] if i else mod) for i in range(len(mod)) + ])) + modules = sorted(set(modules)) + return _wrap_context(mock.module(*modules), self.request) + + +def _wrap_context(context, request): + ret = context.__enter__() + + def fin(): + context.__exit__(*sys.exc_info()) + request.addfinalizer(fin) + return ret + + +@pytest.fixture() +def patching(monkeypatch, request): + """Monkeypath.setattr shortcut. + + Example: + .. code-block:: python + + def test_foo(patching): + # execv value here will be mock.MagicMock by default. + execv = patching('os.execv') + + patching('sys.platform', 'darwin') # set concrete value + patching.setenv('DJANGO_SETTINGS_MODULE', 'x.settings') + + # val will be of type mock.MagicMock by default + val = patching.setitem('path.to.dict', 'KEY') + """ + return _patching(monkeypatch, request) + + +class _stdouts(object): + + def __init__(self, stdout, stderr): + self.stdout = stdout + self.stderr = stderr + + +@pytest.fixture() +def stdouts(request): + return _stdouts(*_wrap_context(mock.stdouts(), request)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case/utils.py new/case-1.4.0/case/utils.py --- old/case-1.2.2/case/utils.py 2016-04-07 00:42:46.000000000 +0200 +++ new/case-1.4.0/case/utils.py 2016-08-19 23:39:00.000000000 +0200 @@ -6,6 +6,7 @@ import io import logging import sys +import unittest from contextlib import contextmanager from six import reraise, string_types @@ -53,6 +54,51 @@ return self.ctx.__exit__(*einfo) +def is_unittest_testcase(cls): + try: + mro = cls.mro + except AttributeError: + pass # py.test uses old style classes + else: + for parent in mro(): + if issubclass(parent, unittest.TestCase): + return True + + +def augment_setup(orig_setup, context, pargs, pkwargs): + def around_setup_method(*args, **kwargs): + try: + contexts = args[0].__rb3dc_contexts__ + except AttributeError: + contexts = args[0].__rb3dc_contexts = [] + p = context(*pargs, **pkwargs) + p.__enter__() + contexts.append(p) + if orig_setup: + return orig_setup(*args, **kwargs) + if orig_setup: + around_setup_method = wraps(orig_setup)(around_setup_method) + around_setup_method.__wrapped__ = orig_setup + return around_setup_method + + +def augment_teardown(orig_teardown, context, pargs, pkwargs): + def around_teardown(*args, **kwargs): + try: + contexts = args[0].__rb3dc_contexts__ + except AttributeError: + pass + else: + for context in contexts: + context.__exit__(*sys.exc_info()) + if orig_teardown: + orig_teardown(*args, **kwargs) + if orig_teardown: + around_teardown = wraps(orig_teardown)(around_teardown) + around_teardown.__wrapped__ = orig_teardown + return around_teardown + + def decorator(predicate): context = contextmanager(predicate) @@ -62,44 +108,29 @@ @wraps(predicate) def decorator(cls): if inspect.isclass(cls): - orig_setup = cls.setUp - orig_teardown = cls.tearDown - - @wraps(cls.setUp) - def around_setup(*args, **kwargs): - try: - contexts = args[0].__rb3dc_contexts__ - except AttributeError: - contexts = args[0].__rb3dc_contexts__ = [] - p = context(*pargs, **pkwargs) - p.__enter__() - contexts.append(p) - return orig_setup(*args, **kwargs) - around_setup.__wrapped__ = cls.setUp - cls.setUp = around_setup - - @wraps(cls.tearDown) - def around_teardown(*args, **kwargs): - try: - contexts = args[0].__rb3dc_contexts__ - except AttributeError: - pass - else: - for context in contexts: - context.__exit__(*sys.exc_info()) - orig_teardown(*args, **kwargs) - around_teardown.__wrapped__ = cls.tearDown - cls.tearDown = around_teardown - + if is_unittest_testcase(cls): + orig_setup = cls.setUp + orig_teardown = cls.tearDown + cls.setUp = augment_setup( + orig_setup, context, pargs, pkwargs) + cls.tearDown = augment_teardown( + orig_teardown, context, pargs, pkwargs) + else: # py.test + orig_setup = getattr(cls, 'setup_method', None) + orig_teardown = getattr(cls, 'teardown_method', None) + cls.setup_method = augment_setup( + orig_setup, context, pargs, pkwargs) + cls.teardown_method = augment_teardown( + orig_teardown, context, pargs, pkwargs) return cls else: @wraps(cls) - def around_case(self, *args, **kwargs): + def around_case(*args, **kwargs): with context(*pargs, **pkwargs) as context_args: context_args = context_args or () if not isinstance(context_args, tuple): context_args = (context_args,) - return cls(*(self,) + args + context_args, **kwargs) + return cls(*args + context_args, **kwargs) return around_case if len(pargs) == 1 and callable(pargs[0]): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case.egg-info/PKG-INFO new/case-1.4.0/case.egg-info/PKG-INFO --- old/case-1.2.2/case.egg-info/PKG-INFO 2016-06-23 23:47:59.000000000 +0200 +++ new/case-1.4.0/case.egg-info/PKG-INFO 2016-10-18 03:56:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: case -Version: 1.2.2 +Version: 1.4.0 Summary: Python unittest Utilities Home-page: http://github.com/celery/case Author: Ask Solem @@ -10,7 +10,9 @@ Python unittest utilities ===================================================================== - :Version: 1.2.2 + |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| + + :Version: 1.4.0 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ @@ -66,19 +68,31 @@ $ pip install https://github.com/celery/case/zipball/master#egg=case - .. image:: https://secure.travis-ci.org/celery/case.png?branch=master + .. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case - .. image:: https://codecov.io/github/celery/case/coverage.svg?branch=master + .. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master - .. image:: https://d2weczhvl823v0.cloudfront.net/celery/case/trend.png - :alt: Bitdeli badge - :target: https://bitdeli.com/free + .. |license| image:: https://img.shields.io/pypi/l/case.svg + :alt: BSD License + :target: https://opensource.org/licenses/BSD-3-Clause + + .. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg + :alt: Case can be installed via wheel + :target: http://pypi.python.org/pypi/case/ + + .. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg + :alt: Supported Python versions. + :target: http://pypi.python.org/pypi/case/ + .. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg + :alt: Support Python implementations. + :target: http://pypi.python.org/pypi/case/ +Keywords: test unit testing pytest unittest mock patch Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case.egg-info/SOURCES.txt new/case-1.4.0/case.egg-info/SOURCES.txt --- old/case-1.2.2/case.egg-info/SOURCES.txt 2016-06-23 23:47:59.000000000 +0200 +++ new/case-1.4.0/case.egg-info/SOURCES.txt 2016-10-18 03:56:27.000000000 +0200 @@ -7,11 +7,13 @@ case/__init__.py case/case.py case/mock.py +case/pytest.py case/skip.py case/utils.py case.egg-info/PKG-INFO case.egg-info/SOURCES.txt case.egg-info/dependency_links.txt +case.egg-info/entry_points.txt case.egg-info/not-zip-safe case.egg-info/requires.txt case.egg-info/top_level.txt @@ -29,6 +31,7 @@ docs/includes/introduction.txt docs/reference/case.case.rst docs/reference/case.mock.rst +docs/reference/case.pytest.rst docs/reference/case.rst docs/reference/case.skip.rst docs/reference/case.utils.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/case.egg-info/entry_points.txt new/case-1.4.0/case.egg-info/entry_points.txt --- old/case-1.2.2/case.egg-info/entry_points.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/case-1.4.0/case.egg-info/entry_points.txt 2016-10-18 03:56:27.000000000 +0200 @@ -0,0 +1,3 @@ +[pytest11] +case = case.pytest + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/includes/introduction.txt new/case-1.4.0/docs/includes/introduction.txt --- old/case-1.2.2/docs/includes/introduction.txt 2016-06-23 23:47:12.000000000 +0200 +++ new/case-1.4.0/docs/includes/introduction.txt 2016-10-18 03:54:44.000000000 +0200 @@ -1,4 +1,4 @@ -:Version: 1.2.2 +:Version: 1.4.0 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.case.rst new/case-1.4.0/docs/reference/case.case.rst --- old/case-1.2.2/docs/reference/case.case.rst 2016-04-07 00:14:14.000000000 +0200 +++ new/case-1.4.0/docs/reference/case.case.rst 2016-08-24 02:41:08.000000000 +0200 @@ -1,5 +1,5 @@ ===================================================== - case.case + ``case.case`` ===================================================== .. contents:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.mock.rst new/case-1.4.0/docs/reference/case.mock.rst --- old/case-1.2.2/docs/reference/case.mock.rst 2016-04-05 23:41:42.000000000 +0200 +++ new/case-1.4.0/docs/reference/case.mock.rst 2016-08-24 02:41:14.000000000 +0200 @@ -1,5 +1,5 @@ ===================================================== - case.mock + ``case.mock`` ===================================================== .. contents:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.pytest.rst new/case-1.4.0/docs/reference/case.pytest.rst --- old/case-1.2.2/docs/reference/case.pytest.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/case-1.4.0/docs/reference/case.pytest.rst 2016-08-24 02:41:50.000000000 +0200 @@ -0,0 +1,11 @@ +===================================================== + ``case.pytest`` +===================================================== + +.. contents:: + :local: +.. currentmodule:: case.pytest + +.. automodule:: case.pytest + :members: + :undoc-members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.rst new/case-1.4.0/docs/reference/case.rst --- old/case-1.2.2/docs/reference/case.rst 2016-04-05 23:42:32.000000000 +0200 +++ new/case-1.4.0/docs/reference/case.rst 2016-08-24 02:41:19.000000000 +0200 @@ -1,5 +1,5 @@ ===================================================== - case + ``case`` ===================================================== .. contents:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.skip.rst new/case-1.4.0/docs/reference/case.skip.rst --- old/case-1.2.2/docs/reference/case.skip.rst 2016-04-05 23:41:54.000000000 +0200 +++ new/case-1.4.0/docs/reference/case.skip.rst 2016-08-24 02:41:26.000000000 +0200 @@ -1,5 +1,5 @@ ===================================================== - case.skip + ``case.skip`` ===================================================== .. contents:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/case.utils.rst new/case-1.4.0/docs/reference/case.utils.rst --- old/case-1.2.2/docs/reference/case.utils.rst 2016-04-05 23:42:04.000000000 +0200 +++ new/case-1.4.0/docs/reference/case.utils.rst 2016-08-24 02:41:40.000000000 +0200 @@ -1,5 +1,5 @@ ===================================================== - case.utils + ``case.utils`` ===================================================== .. contents:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/reference/index.rst new/case-1.4.0/docs/reference/index.rst --- old/case-1.2.2/docs/reference/index.rst 2016-04-05 23:42:46.000000000 +0200 +++ new/case-1.4.0/docs/reference/index.rst 2016-08-24 02:41:01.000000000 +0200 @@ -14,4 +14,5 @@ case.case case.skip case.mock + case.pytest case.utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/docs/templates/readme.txt new/case-1.4.0/docs/templates/readme.txt --- old/case-1.2.2/docs/templates/readme.txt 2016-04-11 22:33:36.000000000 +0200 +++ new/case-1.4.0/docs/templates/readme.txt 2016-08-19 01:32:22.000000000 +0200 @@ -2,18 +2,31 @@ Python unittest utilities ===================================================================== +|build-status| |coverage| |license| |wheel| |pyversion| |pyimp| + .. include:: ../includes/introduction.txt .. include:: ../includes/installation.txt -.. image:: https://secure.travis-ci.org/celery/case.png?branch=master +.. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case -.. image:: https://codecov.io/github/celery/case/coverage.svg?branch=master +.. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master -.. image:: https://d2weczhvl823v0.cloudfront.net/celery/case/trend.png - :alt: Bitdeli badge - :target: https://bitdeli.com/free - +.. |license| image:: https://img.shields.io/pypi/l/case.svg + :alt: BSD License + :target: https://opensource.org/licenses/BSD-3-Clause + +.. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg + :alt: Case can be installed via wheel + :target: http://pypi.python.org/pypi/case/ + +.. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg + :alt: Supported Python versions. + :target: http://pypi.python.org/pypi/case/ + +.. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg + :alt: Support Python implementations. + :target: http://pypi.python.org/pypi/case/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/requirements/docs.txt new/case-1.4.0/requirements/docs.txt --- old/case-1.2.2/requirements/docs.txt 2016-04-08 22:48:09.000000000 +0200 +++ new/case-1.4.0/requirements/docs.txt 2016-09-29 21:26:05.000000000 +0200 @@ -1 +1,2 @@ sphinx_celery>=1.1 +pytest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/requirements/pkgutils.txt new/case-1.4.0/requirements/pkgutils.txt --- old/case-1.2.2/requirements/pkgutils.txt 2016-04-08 03:55:12.000000000 +0200 +++ new/case-1.4.0/requirements/pkgutils.txt 2016-07-02 22:53:29.000000000 +0200 @@ -4,3 +4,4 @@ flakeplus>=1.1 tox>=2.3.1 sphinx2rst>=1.0 +bumpversion diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/setup.cfg new/case-1.4.0/setup.cfg --- old/case-1.2.2/setup.cfg 2016-06-23 23:48:05.000000000 +0200 +++ new/case-1.4.0/setup.cfg 2016-10-18 03:56:30.000000000 +0200 @@ -1,6 +1,12 @@ [nosetests] where = case/tests +[flake8] +ignore = N806, N802, N801, N803 + +[pep257] +ignore = D102,D104,D203,D105,D213 + [wheel] universal = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/case-1.2.2/setup.py new/case-1.4.0/setup.py --- old/case-1.2.2/setup.py 2016-06-22 00:33:14.000000000 +0200 +++ new/case-1.4.0/setup.py 2016-10-10 22:21:32.000000000 +0200 @@ -1,15 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -try: - from setuptools import setup, find_packages - from setuptools.command.test import test -except ImportError: - raise - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages # noqa - from setuptools.command.test import test # noqa +import setuptools import os import re @@ -20,8 +12,6 @@ raise Exception('case requires Python 2.6 or higher.') NAME = 'case' -entrypoints = {} -extra = {} # -*- Classifiers -*- @@ -44,30 +34,18 @@ # -*- Distribution Meta -*- re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)') -re_vers = re.compile(r'VERSION\s*=\s*\((.*?)\)') re_doc = re.compile(r'^"""(.+?)"""') -def rq(s): - return s.strip("\"'") - - def add_default(m): attr_name, attr_value = m.groups() - return ((attr_name, rq(attr_value)), ) - - -def add_version(m): - v = list(map(rq, m.groups()[0].split(', '))) - return (('VERSION', '.'.join(v[0:3]) + ''.join(v[3:])), ) + return ((attr_name, attr_value.strip("\"'")),) def add_doc(m): - return (('doc', m.groups()[0]), ) + return (('doc', m.groups()[0]),) -pats = {re_meta: add_default, - re_vers: add_version, - re_doc: add_doc} +pats = {re_meta: add_default, re_doc: add_doc} here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'case/__init__.py')) as meta_fh: meta = {} @@ -79,7 +57,7 @@ if m: meta.update(handler(m)) -# -*- Installation Requires -*- +# -*- Parsing Requirement Files -*- py_version = sys.version_info is_jython = sys.platform.startswith('java') @@ -108,6 +86,7 @@ def reqs(*f): return [req for subreq in _reqs(*f) for req in subreq] +# -*- Install Requires -*- install_requires = reqs('default.txt') @@ -130,26 +109,28 @@ else: long_description = 'See http://pypi.python.org/pypi/case/' -# -*- Entry Points -*- # - # -*- %%% -*- - -setup( +setuptools.setup( name=NAME, - version=meta['VERSION'], + version=meta['version'], description=meta['doc'], + keywords='test unit testing pytest unittest mock patch', author=meta['author'], author_email=meta['contact'], url=meta['homepage'], platforms=['any'], license='BSD', - packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']), zip_safe=False, install_requires=install_requires, tests_require=tests_require, test_suite='nose.collector', classifiers=classifiers, - entry_points=entrypoints, long_description=long_description, - **extra) + entry_points={ + 'pytest11': ['case = case.pytest'], + }, + packages=setuptools.find_packages( + exclude=['ez_setup', 'tests', 'tests.*'], + ), +)