From aa372c0d48cc6038d2e6d08d043fe3302644aa36 Mon Sep 17 00:00:00 2001 From: Carl George Date: Mon, 26 Jul 2021 11:59:28 -0500 Subject: [PATCH] Latest upstream 3.6.1 Resolves: rhbz#1953232 --- .gitignore | 1 + fix-expectations-pytest-4.6.3.patch | 46 ----------------------------- fix-for-pytest3.patch | 21 ------------- fix-mock-python-3.8.patch | 46 ----------------------------- python-pytest-mock.spec | 8 +++-- sources | 2 +- 6 files changed, 8 insertions(+), 116 deletions(-) delete mode 100644 fix-expectations-pytest-4.6.3.patch delete mode 100644 fix-for-pytest3.patch delete mode 100644 fix-mock-python-3.8.patch diff --git a/.gitignore b/.gitignore index 19b1200..1c6f2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /pytest-mock-3.4.0.tar.gz /pytest-mock-3.5.0.tar.gz /pytest-mock-3.5.1.tar.gz +/pytest-mock-3.6.1.tar.gz diff --git a/fix-expectations-pytest-4.6.3.patch b/fix-expectations-pytest-4.6.3.patch deleted file mode 100644 index f38a52f..0000000 --- a/fix-expectations-pytest-4.6.3.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/fix-for-pytest3.patch b/fix-for-pytest3.patch deleted file mode 100644 index 0b243f8..0000000 --- a/fix-for-pytest3.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/test_pytest_mock.py b/test_pytest_mock.py -index 1e47d0e..e54649a 100644 ---- a/test_pytest_mock.py -+++ b/test_pytest_mock.py -@@ -176,7 +176,7 @@ def __test_failure_message(self, mocker, **kwargs): - stub = mocker.stub(**kwargs) - with pytest.raises(AssertionError) as exc_info: - stub.assert_called_with() -- assert exc_info.value.msg == expected_message -+ assert str(exc_info.value) == expected_message - - def test_failure_message_with_no_name(self, mocker): - self.__test_failure_message(mocker) -@@ -352,7 +352,7 @@ def assert_argument_introspection(left, right): - # test was run by examining sys.argv - verbose = any(a.startswith('-v') for a in sys.argv) - expected = '\n '.join(util._compare_eq_iterable(left, right, verbose)) -- assert expected in e.msg -+ assert expected in str(e) - else: - raise AssertionError("DID NOT RAISE") diff --git a/fix-mock-python-3.8.patch b/fix-mock-python-3.8.patch deleted file mode 100644 index 8a943a7..0000000 --- a/fix-mock-python-3.8.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/python-pytest-mock.spec b/python-pytest-mock.spec index 28ba378..b9d82e1 100644 --- a/python-pytest-mock.spec +++ b/python-pytest-mock.spec @@ -2,8 +2,8 @@ %global file_name pytest_mock Name: python-%{pypi_name} -Version: 3.5.1 -Release: 4%{?dist} +Version: 3.6.1 +Release: 1%{?dist} Summary: Thin-wrapper around the mock package for easier use with py.test License: MIT @@ -55,6 +55,10 @@ sed -i 's/\r$//' README.rst %{python3_sitelib}/%{file_name}-%{version}-py%{python3_version}.egg-info/ %changelog +* Mon Jul 26 2021 Carl George - 3.6.1-1 +- Latest upstream +- Resolves: rhbz#1953232 + * Fri Jul 23 2021 Fedora Release Engineering - 3.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index eafff37..907ccc3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pytest-mock-3.5.1.tar.gz) = 28ab2f239d3dfee134dd4e4fd467109cf3c76cb60aeb537dbc0c21b9a7619d068d54737e33d98c585e9341588fdafba4737ea5f428af37796f55e61ec30373a7 +SHA512 (pytest-mock-3.6.1.tar.gz) = 50a8ffbac1b20b1962558789b24d50c1e7d8d2e2706ee15a576eb5fd1b40d4523482dce7a1078d532b686ff8d38b6d769d356b04241528a0196e14acae0b6199