[Python-modules-commits] [case] 01/07: Import case_1.5.3+dfsg.orig.tar.gz

Christopher Stuart Hoskin mans0954 at moszumanska.debian.org
Sat Feb 25 08:29:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

mans0954 pushed a commit to branch master
in repository case.

commit bc16cbafc230361ff2050dfc2ef8cc29fcea88aa
Author: Christopher Hoskin <mans0954 at debian.org>
Date:   Sat Feb 25 08:12:03 2017 +0000

    Import case_1.5.3+dfsg.orig.tar.gz
---
 Changelog                      |  7 +++++++
 PKG-INFO                       |  4 ++--
 README.rst                     |  2 +-
 case/__init__.py               |  2 +-
 case/mock.py                   | 11 ++++++++++-
 case/pytest.py                 |  9 +++++++--
 docs/includes/introduction.txt |  2 +-
 7 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/Changelog b/Changelog
index 24f0297..dff00a1 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,13 @@
 Changes
 =======
 
+1.5.3
+=====
+:release-date: 2017-02-22 03:26 p.m PST
+:release-by: Ask Solem
+
+- ``patch.multiple`` now works.
+
 1.5.2
 =====
 :release-date: 2016-10-28 03:40 p.m. PDT
diff --git a/PKG-INFO b/PKG-INFO
index c8a46fe..c340919 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: case
-Version: 1.5.2
+Version: 1.5.3
 Summary: Python unittest Utilities
 Home-page: http://github.com/celery/case
 Author: Ask Solem
@@ -12,7 +12,7 @@ Description: ===================================================================
         
         |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
         
-        :Version: 1.5.2
+        :Version: 1.5.3
         :Web: http://case.readthedocs.org/
         :Download: http://pypi.python.org/pypi/case/
         :Source: http://github.com/celery/case/
diff --git a/README.rst b/README.rst
index 7042916..ea955ff 100644
--- a/README.rst
+++ b/README.rst
@@ -4,7 +4,7 @@
 
 |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
 
-:Version: 1.5.2
+:Version: 1.5.3
 :Web: http://case.readthedocs.org/
 :Download: http://pypi.python.org/pypi/case/
 :Source: http://github.com/celery/case/
diff --git a/case/__init__.py b/case/__init__.py
index ce1ded4..d88576e 100644
--- a/case/__init__.py
+++ b/case/__init__.py
@@ -11,7 +11,7 @@ from .mock import ANY, ContextMock, MagicMock, Mock, call, patch, sentinel
 from . import mock
 from . import skip
 
-__version__ = '1.5.2'
+__version__ = '1.5.3'
 __author__ = 'Ask Solem'
 __contact__ = 'ask at celeryproject.org'
 __homepage__ = 'http://github.com/celery/case'
diff --git a/case/mock.py b/case/mock.py
index 4cbae88..9fc3610 100644
--- a/case/mock.py
+++ b/case/mock.py
@@ -201,6 +201,13 @@ def _patch_sig2(target, attribute,
     return new, autospec, new_callable
 
 
+def _patch_sig_multiple(target,
+                        spec=None, create=False, spec_set=None,
+                        autospec=None, new_callable=None, **kwargs):
+    # New is always set, don't have to specify new_callable
+    return True, autospec, new_callable
+
+
 def _create_patcher(fun, signature):
 
     @wraps(fun)
@@ -211,9 +218,11 @@ def _create_patcher(fun, signature):
         return fun(*args, **kwargs)
 
     return patcher
+
+
 patch = _create_patcher(mock.patch, _patch_sig1)
 patch.dict = mock.patch.dict
-patch.multiple = _create_patcher(mock.patch.multiple, _patch_sig2)
+patch.multiple = _create_patcher(mock.patch.multiple, _patch_sig_multiple)
 patch.object = _create_patcher(mock.patch.object, _patch_sig2)
 patch.stopall = mock.patch.stopall
 patch.TEST_PREFIX = mock.patch.TEST_PREFIX
diff --git a/case/pytest.py b/case/pytest.py
index 23d4fed..b997ff9 100644
--- a/case/pytest.py
+++ b/case/pytest.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 import pytest
 import sys
 
-from functools import partial, wraps
+from functools import wraps
 from six import iteritems as items
 
 from . import patch
@@ -41,8 +41,13 @@ class fixture_with_options(object):
         @wraps(fun)
         def _inner(request, *args, **kwargs):
             marker = request.node.get_marker(marker_name)
+            print(request.node)
             return fun(request, *args, **dict(marker.kwargs, **kwargs))
-        _inner.options = partial(getattr(pytest.mark, marker_name))
+
+        def options(*args, **kwargs):
+            return getattr(pytest.mark, marker_name)(*args, **kwargs)
+
+        _inner.options = options
         _inner.__wrapped__ = fun
         return _inner
 
diff --git a/docs/includes/introduction.txt b/docs/includes/introduction.txt
index 92c8994..19f9d62 100644
--- a/docs/includes/introduction.txt
+++ b/docs/includes/introduction.txt
@@ -1,4 +1,4 @@
-:Version: 1.5.2
+:Version: 1.5.3
 :Web: http://case.readthedocs.org/
 :Download: http://pypi.python.org/pypi/case/
 :Source: http://github.com/celery/case/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/case.git



More information about the Python-modules-commits mailing list