From 64b1d9f49e14f54a971e205417b859ab5eddad42d477e87c7b028b21b33ca747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 13 Dec 2024 12:11:13 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-pytest-mock revision 0a5f68aada970abfdd938e2317725cb2 --- fix-tests-python3117.patch | 44 -------------------------------------- pytest-mock-3.12.0.tar.gz | 3 --- pytest-mock-3.14.0.tar.gz | 3 +++ python-pytest-mock.changes | 23 ++++++++++++++++++++ python-pytest-mock.spec | 16 ++++++-------- 5 files changed, 33 insertions(+), 56 deletions(-) delete mode 100644 fix-tests-python3117.patch delete mode 100644 pytest-mock-3.12.0.tar.gz create mode 100644 pytest-mock-3.14.0.tar.gz diff --git a/fix-tests-python3117.patch b/fix-tests-python3117.patch deleted file mode 100644 index c1b97db..0000000 --- a/fix-tests-python3117.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8480bb6d0500f933be039cfec65e04157e6ecffe Mon Sep 17 00:00:00 2001 -From: Bruno Oliveira -Date: Tue, 19 Dec 2023 08:24:23 -0300 -Subject: [PATCH 1/2] Fix tests for Python 3.11 and 3.12 - -Fixes #401. ---- - tests/test_pytest_mock.py | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -Index: pytest-mock-3.12.0/tests/test_pytest_mock.py -=================================================================== ---- pytest-mock-3.12.0.orig/tests/test_pytest_mock.py -+++ pytest-mock-3.12.0/tests/test_pytest_mock.py -@@ -25,6 +25,7 @@ skip_pypy = pytest.mark.skipif( - - # Python 3.8 changed the output formatting (bpo-35500), which has been ported to mock 3.0 - NEW_FORMATTING = sys.version_info >= (3, 8) -+NEWEST_FORMATTING = sys.version_info >= (3, 11, 7) - - if sys.version_info[:2] >= (3, 8): - from unittest.mock import AsyncMock -@@ -240,15 +241,18 @@ class TestMockerStub: - - def __test_failure_message(self, mocker: MockerFixture, **kwargs: Any) -> None: - expected_name = kwargs.get("name") or "mock" -- if NEW_FORMATTING: -+ if NEWEST_FORMATTING: -+ msg = "expected call not found.\nExpected: {0}()\n Actual: not called." -+ elif NEW_FORMATTING: - msg = "expected call not found.\nExpected: {0}()\nActual: not called." - else: - msg = "Expected call: {0}()\nNot called" - expected_message = msg.format(expected_name) - stub = mocker.stub(**kwargs) -- with pytest.raises(AssertionError) as exc_info: -+ with pytest.raises( -+ AssertionError, match=re.escape(expected_message) -+ ) as exc_info: - stub.assert_called_with() -- assert str(exc_info.value) == expected_message - - def test_failure_message_with_no_name(self, mocker: MagicMock) -> None: - self.__test_failure_message(mocker) diff --git a/pytest-mock-3.12.0.tar.gz b/pytest-mock-3.12.0.tar.gz deleted file mode 100644 index 5997f4f..0000000 --- a/pytest-mock-3.12.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31a40f038c22cad32287bb43932054451ff5583ff094bca6f675df2f8bc1a6e9 -size 32139 diff --git a/pytest-mock-3.14.0.tar.gz b/pytest-mock-3.14.0.tar.gz new file mode 100644 index 0000000..7170545 --- /dev/null +++ b/pytest-mock-3.14.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0 +size 32814 diff --git a/python-pytest-mock.changes b/python-pytest-mock.changes index 2bed778..9d20a90 100644 --- a/python-pytest-mock.changes +++ b/python-pytest-mock.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Mon Sep 2 01:46:28 UTC 2024 - Steve Kowalik + +- Drop python-py requirement, no longer required. + +------------------------------------------------------------------- +Mon Jul 8 10:47:18 UTC 2024 - Dirk Müller + +- update to 3.14.0: + * #415: MockType and AsyncMockType can be imported from + pytest_mock for type annotation purposes. + * #420: Fixed a regression which would cause + mocker.patch.object to not being properly cleared between + tests. + * #417: spy now has spy_return_list, which is a list containing + all the values returned by the spied function. + * pytest-mock now requires pytest>=6.2.5. + * #410: pytest-mock's setup.py file is removed. If you relied + on this file, e.g. to install pytest using setup.py install, + please see Why you shouldn't invoke setup.py directly for + alternatives. +- drop fix-tests-python3117.patch (upstream) + ------------------------------------------------------------------- Wed Dec 20 12:28:16 UTC 2023 - Daniel Garcia diff --git a/python-pytest-mock.spec b/python-pytest-mock.spec index 4d9d05e..24ca30a 100644 --- a/python-pytest-mock.spec +++ b/python-pytest-mock.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-mock # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,23 +18,21 @@ %{?sle15_python_module_pythons} Name: python-pytest-mock -Version: 3.12.0 +Version: 3.14.0 Release: 0 Summary: Thin-wrapper around the mock package for easier use with pytest License: MIT URL: https://github.com/pytest-dev/pytest-mock Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz -# PATCH-FIX-UPSTREAM: fix-tests-python3117.patch gh#pytest-dev/pytest-mock#403 -Patch0: fix-tests-python3117.patch BuildRequires: %{python_module base >= 3.8} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 5} BuildRequires: %{python_module pytest-asyncio} -BuildRequires: %{python_module py} BuildRequires: %{python_module setuptools >= 36} BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-py Requires: python-pytest BuildArch: noarch %python_subpackages @@ -48,10 +46,10 @@ patches at the end of a test %autosetup -p1 -n pytest-mock-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -61,6 +59,6 @@ patches at the end of a test %doc CHANGELOG.rst %license LICENSE %{python_sitelib}/pytest_mock -%{python_sitelib}/pytest_mock-%{version}*-info +%{python_sitelib}/pytest_mock-%{version}.dist-info %changelog