From 24f04b847b90c4a9368bbcc7036ea076ca0c90d0be7c31c0efeacd3c17a93ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 30 Sep 2019 12:24:55 +0000 Subject: [PATCH] - Update to 1.11.0: * The object returned by mocker.spy now also tracks the return value of the spied method/function. - Drop merged patch mock3.patch and fix_tests.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=16 --- fix_tests.patch | 46 -------------------------------------- mock3.patch | 46 -------------------------------------- pytest-mock-1.10.4.tar.gz | 3 --- pytest-mock-1.11.0.tar.gz | 3 +++ python-pytest-mock.changes | 8 +++++++ python-pytest-mock.spec | 5 +---- 6 files changed, 12 insertions(+), 99 deletions(-) delete mode 100644 fix_tests.patch delete mode 100644 mock3.patch delete mode 100644 pytest-mock-1.10.4.tar.gz create mode 100644 pytest-mock-1.11.0.tar.gz diff --git a/fix_tests.patch b/fix_tests.patch deleted file mode 100644 index e329955..0000000 --- a/fix_tests.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 970e4b1f8cfd6bd750b4c8240efad378cbf049c2 Mon Sep 17 00:00:00 2001 -From: Bruno Oliveira -Date: Mon, 1 Jul 2019 19:31:36 -0300 -Subject: [PATCH] Fix tests expectations with latest pytest - -Fix #149 ---- - test_pytest_mock.py | 2 +- - tox.ini | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/test_pytest_mock.py b/test_pytest_mock.py -index 562ff0c..cdc04fe 100644 ---- a/test_pytest_mock.py -+++ b/test_pytest_mock.py -@@ -639,7 +639,7 @@ def test(mocker): - "*Use -v to get the full diff*", - "*Kwargs:*", - "*assert {} == {'bar': 4}*", -- "*Right contains more items:*", -+ "*Right contains* more item*", - "*{'bar': 4}*", - "*Use -v to get the full diff*", - ] -diff --git a/tox.ini b/tox.ini -index 427b25f..98117bf 100644 ---- a/tox.ini -+++ b/tox.ini -@@ -10,7 +10,7 @@ commands = - - [testenv:norewrite] - commands = -- pytest test_pytest_mock.py --assert=plain -ra -+ pytest test_pytest_mock.py --assert=plain - - [testenv:linting] - skipsdist = True -@@ -20,7 +20,7 @@ basepython = python3.6 - commands = pre-commit run --all-files --show-diff-on-failure - - [pytest] --addopts = -ra -+addopts = -r a - - [flake8] - max-line-length = 88 diff --git a/mock3.patch b/mock3.patch deleted file mode 100644 index 3219e28..0000000 --- a/mock3.patch +++ /dev/null @@ -1,46 +0,0 @@ -From b2683fdfc2fbd67dfc14bfc8e9d2c06530975397 Mon Sep 17 00:00:00 2001 -From: Bruno Oliveira -Date: Fri, 3 May 2019 08:58:31 -0300 -Subject: [PATCH] Fix tests due to new formatting in mock 3.0 and python 3.8 - ---- - test_pytest_mock.py | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/test_pytest_mock.py b/test_pytest_mock.py -index 7bc38cb..562ff0c 100644 ---- a/test_pytest_mock.py -+++ b/test_pytest_mock.py -@@ -10,11 +10,11 @@ - - # could not make some of the tests work on PyPy, patches are welcome! - skip_pypy = pytest.mark.skipif( -- platform.python_implementation() == "PyPy", reason="could not make work on pypy" -+ platform.python_implementation() == "PyPy", reason="could not make it work on pypy" - ) - --# Python 3.8 changed the output formatting (bpo-35500). --PY38 = sys.version_info >= (3, 8) -+# Python 3.8 changed the output formatting (bpo-35500), which has been ported to mock 3.0 -+NEW_FORMATTING = sys.version_info >= (3, 8) or sys.version_info[0] == 2 - - - @pytest.fixture -@@ -209,7 +209,7 @@ def test_repr_with_name(self, mocker): - - def __test_failure_message(self, mocker, **kwargs): - expected_name = kwargs.get("name") or "mock" -- if PY38: -+ if NEW_FORMATTING: - msg = "expected call not found.\nExpected: {0}()\nActual: not called." - else: - msg = "Expected call: {0}()\nNot called" -@@ -620,7 +620,7 @@ def test(mocker): - """ - ) - result = testdir.runpytest("-s") -- if PY38: -+ if NEW_FORMATTING: - expected_lines = [ - "*AssertionError: expected call not found.", - "*Expected: mock('', bar=4)", diff --git a/pytest-mock-1.10.4.tar.gz b/pytest-mock-1.10.4.tar.gz deleted file mode 100644 index 4f2c38f..0000000 --- a/pytest-mock-1.10.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568 -size 18790 diff --git a/pytest-mock-1.11.0.tar.gz b/pytest-mock-1.11.0.tar.gz new file mode 100644 index 0000000..c2f8ecf --- /dev/null +++ b/pytest-mock-1.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fd5ffb33b7041aea60a77f77b98e05d5acd577d53a01bf2ff0ca9780c6e3d84 +size 18893 diff --git a/python-pytest-mock.changes b/python-pytest-mock.changes index 9a7abfd..d4143d2 100644 --- a/python-pytest-mock.changes +++ b/python-pytest-mock.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Sep 30 12:22:25 UTC 2019 - Tomáš Chvátal + +- Update to 1.11.0: + * The object returned by mocker.spy now also tracks the return + value of the spied method/function. +- Drop merged patch mock3.patch and fix_tests.patch + ------------------------------------------------------------------- Wed Sep 11 08:21:28 UTC 2019 - Tomáš Chvátal diff --git a/python-pytest-mock.spec b/python-pytest-mock.spec index 5df6c1e..5926acd 100644 --- a/python-pytest-mock.spec +++ b/python-pytest-mock.spec @@ -20,15 +20,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-pytest-mock -Version: 1.10.4 +Version: 1.11.0 Release: 0 Summary: Thin-wrapper around the mock package for easier use with pytest License: MIT Group: Development/Languages/Python URL: https://github.com/pytest-dev/pytest-mock Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz -Patch0: mock3.patch -Patch1: fix_tests.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools >= 36} BuildRequires: %{python_module setuptools_scm} @@ -52,7 +50,6 @@ of a test %prep %setup -q -n pytest-mock-%{version} -%autopatch -p1 %build %python_build