[Python-modules-commits] [pytest-mock] 02/06: Import pytest-mock_1.2.orig.tar.gz
Vincent Bernat
bernat at moszumanska.debian.org
Sat Oct 15 19:05:14 UTC 2016
This is an automated email from the git hooks/post-receive script.
bernat pushed a commit to branch master
in repository pytest-mock.
commit bdae00c258a6eb42dcd6e1f0dd4ddfc3be17723c
Author: Vincent Bernat <bernat at debian.org>
Date: Sat Sep 3 12:31:16 2016 +0200
Import pytest-mock_1.2.orig.tar.gz
---
PKG-INFO | 3 ++-
README.rst | 1 +
pytest_mock.egg-info/PKG-INFO | 3 ++-
pytest_mock.py | 10 +++++-----
test_pytest_mock.py | 4 ++--
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 1ee9ff6..8733eaf 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-mock
-Version: 1.1
+Version: 1.2
Summary: Thin-wrapper around the mock package for easier use with py.test
Home-page: https://github.com/pytest-dev/pytest-mock/
Author: Bruno Oliveira
@@ -77,6 +77,7 @@ Description: ===========
* `PropertyMock <https://docs.python.org/3/library/unittest.mock.html#unittest.mock.PropertyMock>`_
* `ANY <https://docs.python.org/3/library/unittest.mock.html#any>`_
* `call <https://docs.python.org/3/library/unittest.mock.html#call>`_ *(Version 1.1)*
+ * `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
Spy
diff --git a/README.rst b/README.rst
index d0d3033..31a6bc6 100644
--- a/README.rst
+++ b/README.rst
@@ -69,6 +69,7 @@ Some objects from the ``mock`` module are accessible directly from ``mocker`` fo
* `PropertyMock <https://docs.python.org/3/library/unittest.mock.html#unittest.mock.PropertyMock>`_
* `ANY <https://docs.python.org/3/library/unittest.mock.html#any>`_
* `call <https://docs.python.org/3/library/unittest.mock.html#call>`_ *(Version 1.1)*
+* `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
Spy
diff --git a/pytest_mock.egg-info/PKG-INFO b/pytest_mock.egg-info/PKG-INFO
index 1ee9ff6..8733eaf 100644
--- a/pytest_mock.egg-info/PKG-INFO
+++ b/pytest_mock.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-mock
-Version: 1.1
+Version: 1.2
Summary: Thin-wrapper around the mock package for easier use with py.test
Home-page: https://github.com/pytest-dev/pytest-mock/
Author: Bruno Oliveira
@@ -77,6 +77,7 @@ Description: ===========
* `PropertyMock <https://docs.python.org/3/library/unittest.mock.html#unittest.mock.PropertyMock>`_
* `ANY <https://docs.python.org/3/library/unittest.mock.html#any>`_
* `call <https://docs.python.org/3/library/unittest.mock.html#call>`_ *(Version 1.1)*
+ * `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
Spy
diff --git a/pytest_mock.py b/pytest_mock.py
index 7c8ebfc..bbb1973 100644
--- a/pytest_mock.py
+++ b/pytest_mock.py
@@ -1,14 +1,13 @@
import inspect
-import sys
import pytest
-if sys.version_info >= (3, 3): # pragma: no cover
- import unittest.mock as mock_module
-else:
+try:
import mock as mock_module
+except ImportError:
+ import unittest.mock as mock_module
-version = '1.1'
+version = '1.2'
class MockFixture(object):
@@ -22,6 +21,7 @@ class MockFixture(object):
PropertyMock = mock_module.PropertyMock
call = mock_module.call
ANY = mock_module.ANY
+ sentinel = mock_module.sentinel
def __init__(self):
self._patches = [] # list of mock._patch objects
diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 3980462..1d55295 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -132,7 +132,7 @@ def test_deprecated_mock(mock, tmpdir):
assert os.listdir(str(tmpdir)) == []
- at pytest.mark.parametrize('name', ['MagicMock', 'PropertyMock', 'Mock', 'call', 'ANY'])
+ at pytest.mark.parametrize('name', ['MagicMock', 'PropertyMock', 'Mock', 'call', 'ANY', 'sentinel'])
def test_mocker_aliases(name):
from pytest_mock import mock_module, MockFixture
@@ -455,7 +455,7 @@ def test_monkeypatch_ini(mocker, testdir):
assert result.ret == 0
-def test_parse_ini_boolean(testdir):
+def test_parse_ini_boolean():
import pytest_mock
assert pytest_mock.parse_ini_boolean('True') is True
assert pytest_mock.parse_ini_boolean('false') is False
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest-mock.git
More information about the Python-modules-commits
mailing list