17
0

8 Commits

Author SHA256 Message Date
03d7e55547 Accepting request 1308060 from devel:languages:python:pytest
- update to 3.15.1:
  * #529: Fixed itertools._tee object has no attribute error --
    now duplicate_iterators=True must be passed to mocker.spy to
    duplicate iterators.

OBS-URL: https://build.opensuse.org/request/show/1308060
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=30
2025-09-30 15:48:29 +00:00
8ae8bd8a5d - update to 3.15.1:
* #529: Fixed itertools._tee object has no attribute error --
    now duplicate_iterators=True must be passed to mocker.spy to
    duplicate iterators.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=48
2025-09-29 20:31:24 +00:00
8e31a191bf Accepting request 1303678 from devel:languages:python:pytest
- update to 3.15.0:
  * Python 3.8 (EOL) is no longer supported.
  * #524: Added spy_return_iter to mocker.spy, which contains a
    duplicate of the return value of the spied method if it is an
    Iterator.
  * #503: Python 3.14 is now officially supported.

- Drop python-py requirement, no longer required.

OBS-URL: https://build.opensuse.org/request/show/1303678
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=29
2025-09-11 12:38:17 +00:00
c84a87535b - update to 3.15.0:
* Python 3.8 (EOL) is no longer supported.
  * #524: Added spy_return_iter to mocker.spy, which contains a
    duplicate of the return value of the spied method if it is an
    Iterator.
  * #503: Python 3.14 is now officially supported.
- Drop python-py requirement, no longer required.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=46
2025-09-10 17:13:50 +00:00
d2e99c64af Accepting request 1198186 from devel:languages:python:pytest
- Drop python-py requirement, no longer required.

OBS-URL: https://build.opensuse.org/request/show/1198186
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=28
2024-09-03 11:37:34 +00:00
5aff691208 - Drop python-py requirement, no longer required.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=44
2024-09-02 01:46:41 +00:00
b6cce7f3b9 Accepting request 1186141 from devel:languages:python:pytest
- 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)

OBS-URL: https://build.opensuse.org/request/show/1186141
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=27
2024-07-10 14:47:48 +00:00
34d13e8ee5 - 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)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=42
2024-07-08 10:49:16 +00:00
5 changed files with 53 additions and 58 deletions

View File

@@ -1,44 +0,0 @@
From 8480bb6d0500f933be039cfec65e04157e6ecffe Mon Sep 17 00:00:00 2001
From: Bruno Oliveira <nicoddemus@gmail.com>
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)

BIN
pytest-mock-3.12.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1849a238f6f396da19762269de72cb1814ab44416fa73a8686deac10b0d87a0f
size 34036

View File

@@ -1,3 +1,44 @@
-------------------------------------------------------------------
Mon Sep 29 20:31:05 UTC 2025 - Dirk Müller <dmueller@suse.com>
- update to 3.15.1:
* #529: Fixed itertools._tee object has no attribute error --
now duplicate_iterators=True must be passed to mocker.spy to
duplicate iterators.
-------------------------------------------------------------------
Wed Sep 10 17:13:40 UTC 2025 - Dirk Müller <dmueller@suse.com>
- update to 3.15.0:
* Python 3.8 (EOL) is no longer supported.
* #524: Added spy_return_iter to mocker.spy, which contains a
duplicate of the return value of the spied method if it is an
Iterator.
* #503: Python 3.14 is now officially supported.
-------------------------------------------------------------------
Mon Sep 2 01:46:28 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Drop python-py requirement, no longer required.
-------------------------------------------------------------------
Mon Jul 8 10:47:18 UTC 2024 - Dirk Müller <dmueller@suse.com>
- 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 <daniel.garcia@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-mock
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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.15.1
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
Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest_mock-%{version}.tar.gz
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
@@ -45,13 +43,13 @@ provided by the `mock` package, but with the benefit of not having to worry abou
patches at the end of a test
%prep
%autosetup -p1 -n pytest-mock-%{version}
%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