Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-mock for 
openSUSE:Factory checked in at 2023-07-26 13:21:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-mock (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-mock.new.15225 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-mock"

Wed Jul 26 13:21:42 2023 rev:24 rq:1100451 version:3.11.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-mock/python-pytest-mock.changes    
2023-04-25 16:53:31.210214335 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-mock.new.15225/python-pytest-mock.changes
 2023-07-26 13:21:50.703279707 +0200
@@ -1,0 +2,8 @@
+Mon Jul 24 19:10:29 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 3.11.1:
+  * Fixed introspection for failed ``assert_has_calls``
+  * Updated type annotations for ``mocker.patch`` and
+    ``mocker.spy`` (`#364`_).
+
+-------------------------------------------------------------------

Old:
----
  pytest-mock-3.10.0.tar.gz

New:
----
  pytest-mock-3.11.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-mock.spec ++++++
--- /var/tmp/diff_new_pack.GGPB2c/_old  2023-07-26 13:21:51.339283307 +0200
+++ /var/tmp/diff_new_pack.GGPB2c/_new  2023-07-26 13:21:51.343283330 +0200
@@ -16,10 +16,9 @@
 #
 
 
-%define skip_python2 1
 %{?sle15_python_module_pythons}
 Name:           python-pytest-mock
-Version:        3.10.0
+Version:        3.11.1
 Release:        0
 Summary:        Thin-wrapper around the mock package for easier use with pytest
 License:        MIT

++++++ pytest-mock-3.10.0.tar.gz -> pytest-mock-3.11.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/.github/workflows/deploy.yml 
new/pytest-mock-3.11.1/.github/workflows/deploy.yml
--- old/pytest-mock-3.10.0/.github/workflows/deploy.yml 2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/.github/workflows/deploy.yml 2023-06-16 
01:56:41.000000000 +0200
@@ -1,39 +1,67 @@
 name: deploy
 
 on:
-  push:
-    tags:
-      - "v*"
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version'
+        required: true
+        default: '1.2.3'
 
 jobs:
 
+  package:
+    runs-on: ubuntu-latest
+    env:
+      SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
+
+    steps:
+    - uses: actions/checkout@v3
+
+    - name: Build and Check Package
+      uses: hynek/build-and-inspect-python-package@v1.5
+
   deploy:
+    needs: package
     runs-on: ubuntu-latest
+    environment: deploy
+    permissions:
+      id-token: write  # For PyPI trusted publishers.
+      contents: write  # For tag and release notes.
 
     steps:
-    - uses: actions/checkout@v1
-    - name: Set up Python
-      uses: actions/setup-python@v1
+    - uses: actions/checkout@v3
+
+    - name: Download Package
+      uses: actions/download-artifact@v3
       with:
-        python-version: "3.7"
-    - name: Install wheel
-      run: |
-        python -m pip install --upgrade pip
-        pip install build
-    - name: Build package
-      run: |
-        python -m build
+        name: Packages
+        path: dist
+
     - name: Publish package to PyPI
-      uses: pypa/gh-action-pypi-publish@master
+      uses: pypa/gh-action-pypi-publish@v1.8.5
+
+    - name: Push tag
+      run: |
+        git config user.name "pytest bot"
+        git config user.email "pytest...@gmail.com"
+        git tag --annotate --message=v${{ github.event.inputs.version }} v${{ 
github.event.inputs.version }} ${{ github.sha }}
+        git push origin v${{ github.event.inputs.version }}
+
+    - name: Set up Python
+      uses: actions/setup-python@v4.5.0
       with:
-        user: __token__
-        password: ${{ secrets.pypi_token }}
+        python-version: "3.10"
+
     - name: Generate release notes
       run: |
         pip install pypandoc
         sudo apt-get install pandoc
         python scripts/gen-release-notes.py
+
     - name: GitHub Release
       uses: softprops/action-gh-release@v1
       with:
         body_path: scripts/latest-release-notes.md
+        files: dist/*
+        tag_name: v${{ github.event.inputs.version }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/.github/workflows/test.yml 
new/pytest-mock-3.11.1/.github/workflows/test.yml
--- old/pytest-mock-3.10.0/.github/workflows/test.yml   2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/.github/workflows/test.yml   2023-06-16 
01:56:41.000000000 +0200
@@ -1,17 +1,37 @@
 name: test
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - main
+      - "test-me-*"
+
+  pull_request:
+
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
 
 jobs:
 
+  package:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - name: Build and Check Package
+        uses: hynek/build-and-inspect-python-package@v1.5
+
   test:
 
+    needs: [package]
+
     runs-on: ${{ matrix.os }}
 
     strategy:
       fail-fast: false
       matrix:
-        python: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
+        python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
         os: [ubuntu-latest, windows-latest]
         include:
           - python: "3.7"
@@ -22,19 +42,29 @@
             tox_env: "py39"
           - python: "3.10"
             tox_env: "py310"
-          - python: "3.11-dev"
+          - python: "3.11"
             tox_env: "py311"
 
     steps:
     - uses: actions/checkout@v3
+
+    - name: Download Package
+      uses: actions/download-artifact@v3
+      with:
+        name: Packages
+        path: dist
+
     - name: Set up Python
       uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python }}
+
     - name: Install tox
       run: |
         python -m pip install --upgrade pip
         pip install tox
+
     - name: Test
+      shell: bash
       run: |
-        tox -e ${{ matrix.tox_env }}
+        tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/.pre-commit-config.yaml 
new/pytest-mock-3.11.1/.pre-commit-config.yaml
--- old/pytest-mock-3.10.0/.pre-commit-config.yaml      2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/.pre-commit-config.yaml      2023-06-16 
01:56:41.000000000 +0200
@@ -1,12 +1,12 @@
 exclude: '^($|.*\.bin)'
 repos:
   - repo: https://github.com/psf/black
-    rev: 22.8.0
+    rev: 23.3.0
     hooks:
       - id: black
         args: [--safe, --quiet]
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.3.0
+    rev: v4.4.0
     hooks:
       - id: trailing-whitespace
       - id: end-of-file-fixer
@@ -18,13 +18,13 @@
         files: ^(CHANGELOG.rst|README.rst|HOWTORELEASE.rst|changelog/.*)$
         language: python
         additional_dependencies: [pygments, restructuredtext_lint]
-  - repo: https://github.com/asottile/reorder_python_imports
-    rev: v3.8.3
+  - repo: https://github.com/asottile/reorder-python-imports
+    rev: v3.9.0
     hooks:
     - id: reorder-python-imports
       args: ['--application-directories=.:src']
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.981  # NOTE: keep this in sync with tox.ini
+    rev: v1.3.0  # NOTE: keep this in sync with tox.ini
     hooks:
       - id: mypy
         files: ^(src|tests)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/CHANGELOG.rst 
new/pytest-mock-3.11.1/CHANGELOG.rst
--- old/pytest-mock-3.10.0/CHANGELOG.rst        2022-10-05 20:52:25.000000000 
+0200
+++ new/pytest-mock-3.11.1/CHANGELOG.rst        2023-06-16 01:56:41.000000000 
+0200
@@ -1,6 +1,17 @@
 Releases
 ========
 
+3.11.1 (2023-06-15)
+-------------------
+
+* Fixed introspection for failed ``assert_has_calls`` (`#365`_).
+
+* Updated type annotations for ``mocker.patch`` and ``mocker.spy`` (`#364`_).
+
+.. _#365: https://github.com/pytest-dev/pytest-mock/pull/365
+.. _#364: https://github.com/pytest-dev/pytest-mock/pull/364
+
+
 3.10.0 (2022-10-05)
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/PKG-INFO 
new/pytest-mock-3.11.1/PKG-INFO
--- old/pytest-mock-3.10.0/PKG-INFO     2022-10-05 20:52:39.000000000 +0200
+++ new/pytest-mock-3.11.1/PKG-INFO     2023-06-16 01:57:01.762833600 +0200
@@ -1,11 +1,15 @@
 Metadata-Version: 2.1
 Name: pytest-mock
-Version: 3.10.0
+Version: 3.11.1
 Summary: Thin-wrapper around the mock package for easier use with pytest
 Home-page: https://github.com/pytest-dev/pytest-mock/
 Author: Bruno Oliveira
 Author-email: nicodde...@gmail.com
 License: MIT
+Project-URL: Documentation, https://pytest-mock.readthedocs.io/en/latest/
+Project-URL: Changelog, 
https://pytest-mock.readthedocs.io/en/latest/changelog.html
+Project-URL: Source, https://github.com/pytest-dev/pytest-mock/
+Project-URL: Tracker, https://github.com/pytest-dev/pytest-mock/issues
 Keywords: pytest mock
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
@@ -22,6 +26,7 @@
 Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Topic :: Software Development :: Testing
 Requires-Python: >=3.7
+Description-Content-Type: text/x-rst
 Provides-Extra: dev
 License-File: LICENSE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/RELEASING.rst 
new/pytest-mock-3.11.1/RELEASING.rst
--- old/pytest-mock-3.10.0/RELEASING.rst        2022-10-05 20:52:25.000000000 
+0200
+++ new/pytest-mock-3.11.1/RELEASING.rst        2023-06-16 01:56:41.000000000 
+0200
@@ -1,7 +1,7 @@
 Here are the steps on how to make a new release.
 
-1. Create a ``release-VERSION`` branch from ``upstream/master``.
+1. Create a ``release-VERSION`` branch from ``upstream/main``.
 2. Update ``CHANGELOG.rst``.
-3. Push a branch with the changes.
-4. Once all builds pass, push a tag to ``upstream``.
+3. Push the branch to ``upstream``.
+4. Once all tests pass, start the ``deploy`` workflow manually.
 5. Merge the PR.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/docs/contributing.rst 
new/pytest-mock-3.11.1/docs/contributing.rst
--- old/pytest-mock-3.10.0/docs/contributing.rst        2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/docs/contributing.rst        2023-06-16 
01:56:41.000000000 +0200
@@ -15,7 +15,7 @@
 
 .. code-block:: console
 
-    $ tox -e py38,linting
+    $ tox -e py38
 
 Style checks and formatting are done automatically during commit courtesy of
 `pre-commit <https://pre-commit.com>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/scripts/gen-release-notes.py 
new/pytest-mock-3.11.1/scripts/gen-release-notes.py
--- old/pytest-mock-3.10.0/scripts/gen-release-notes.py 2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/scripts/gen-release-notes.py 2023-06-16 
01:56:41.000000000 +0200
@@ -20,6 +20,11 @@
 first_heading_found = False
 for line in md_text.splitlines():
     if line.startswith("# "):
+        # Skip the first section (normally # Releases).
+        pass
+    elif line.startswith("## "):
+        # First second-level section, note it and skip the text,
+        # as we are only interested in the individual release items.
         if first_heading_found:
             break
         first_heading_found = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/setup.py 
new/pytest-mock-3.11.1/setup.py
--- old/pytest-mock-3.10.0/setup.py     2022-10-05 20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/setup.py     2023-06-16 01:56:41.000000000 +0200
@@ -20,6 +20,7 @@
     author_email="nicodde...@gmail.com",
     description="Thin-wrapper around the mock package for easier use with 
pytest",
     long_description=open("README.rst", encoding="utf-8").read(),
+    long_description_content_type="text/x-rst",
     keywords="pytest mock",
     extras_require={"dev": ["pre-commit", "tox", "pytest-asyncio"]},
     classifiers=[
@@ -37,4 +38,10 @@
         "Programming Language :: Python :: 3 :: Only",
         "Topic :: Software Development :: Testing",
     ],
+    project_urls={
+        "Documentation": "https://pytest-mock.readthedocs.io/en/latest/";,
+        "Changelog": 
"https://pytest-mock.readthedocs.io/en/latest/changelog.html";,
+        "Source": "https://github.com/pytest-dev/pytest-mock/";,
+        "Tracker": "https://github.com/pytest-dev/pytest-mock/issues";,
+    },
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/src/pytest_mock/_version.py 
new/pytest-mock-3.11.1/src/pytest_mock/_version.py
--- old/pytest-mock-3.10.0/src/pytest_mock/_version.py  2022-10-05 
20:52:39.000000000 +0200
+++ new/pytest-mock-3.11.1/src/pytest_mock/_version.py  2023-06-16 
01:57:01.000000000 +0200
@@ -1,5 +1,4 @@
-# coding: utf-8
 # file generated by setuptools_scm
 # don't change, don't track in version control
-__version__ = version = '3.10.0'
-__version_tuple__ = version_tuple = (3, 10, 0)
+__version__ = version = '3.11.1'
+__version_tuple__ = version_tuple = (3, 11, 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/src/pytest_mock/plugin.py 
new/pytest-mock-3.11.1/src/pytest_mock/plugin.py
--- old/pytest-mock-3.10.0/src/pytest_mock/plugin.py    2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/src/pytest_mock/plugin.py    2023-06-16 
01:56:41.000000000 +0200
@@ -27,10 +27,16 @@
 
 _T = TypeVar("_T")
 
-if sys.version_info[:2] > (3, 7):
+if sys.version_info >= (3, 8):
     AsyncMockType = unittest.mock.AsyncMock
+    MockType = Union[
+        unittest.mock.MagicMock,
+        unittest.mock.AsyncMock,
+        unittest.mock.NonCallableMagicMock,
+    ]
 else:
     AsyncMockType = Any
+    MockType = Union[unittest.mock.MagicMock, 
unittest.mock.NonCallableMagicMock]
 
 
 class PytestMockWarning(UserWarning):
@@ -112,7 +118,7 @@
         else:
             raise ValueError("This mock object is not registered")
 
-    def spy(self, obj: object, name: str) -> unittest.mock.MagicMock:
+    def spy(self, obj: object, name: str) -> MockType:
         """
         Create a spy of method. It will run method normally, but it is now
         possible to use `mock` call features with it, like call count.
@@ -205,13 +211,13 @@
 
         def _start_patch(
             self, mock_func: Any, warn_on_mock_enter: bool, *args: Any, 
**kwargs: Any
-        ) -> unittest.mock.MagicMock:
+        ) -> MockType:
             """Patches something by calling the given function from the mock
             module, registering the patch to stop it later and returns the
             mock object resulting from the mock call.
             """
             p = mock_func(*args, **kwargs)
-            mocked = p.start()  # type: unittest.mock.MagicMock
+            mocked: MockType = p.start()
             self.__patches_and_mocks.append((p, mocked))
             if hasattr(mocked, "reset_mock"):
                 # check if `mocked` is actually a mock object, as depending on 
autospec or target
@@ -242,7 +248,7 @@
             autospec: Optional[object] = None,
             new_callable: object = None,
             **kwargs: Any
-        ) -> unittest.mock.MagicMock:
+        ) -> MockType:
             """API to mock.patch.object"""
             if new is self.DEFAULT:
                 new = self.mock_module.DEFAULT
@@ -271,7 +277,7 @@
             autospec: Optional[builtins.object] = None,
             new_callable: builtins.object = None,
             **kwargs: Any
-        ) -> unittest.mock.MagicMock:
+        ) -> MockType:
             """This is equivalent to mock.patch.object except that the 
returned mock
             does not issue a warning when used as a context manager."""
             if new is self.DEFAULT:
@@ -299,7 +305,7 @@
             autospec: Optional[builtins.object] = None,
             new_callable: Optional[builtins.object] = None,
             **kwargs: Any
-        ) -> Dict[str, unittest.mock.MagicMock]:
+        ) -> Dict[str, MockType]:
             """API to mock.patch.multiple"""
             return self._start_patch(
                 self.mock_module.patch.multiple,
@@ -341,7 +347,7 @@
             autospec: Optional[builtins.object] = ...,
             new_callable: None = ...,
             **kwargs: Any
-        ) -> unittest.mock.MagicMock:
+        ) -> MockType:
             ...
 
         @overload
@@ -467,6 +473,54 @@
         raise e
 
 
+def assert_has_calls_wrapper(
+    __wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any
+) -> None:
+    __tracebackhide__ = True
+    try:
+        __wrapped_mock_method__(*args, **kwargs)
+        return
+    except AssertionError as e:
+        any_order = kwargs.get("any_order", False)
+        if getattr(e, "_mock_introspection_applied", 0) or any_order:
+            msg = str(e)
+        else:
+            __mock_self = args[0]
+            msg = str(e)
+            if __mock_self.call_args_list is not None:
+                actual_calls = list(__mock_self.call_args_list)
+                expect_calls = args[1]
+                introspection = ""
+                from itertools import zip_longest
+
+                for actual_call, expect_call in zip_longest(actual_calls, 
expect_calls):
+                    if actual_call is not None:
+                        actual_args, actual_kwargs = actual_call
+                    else:
+                        actual_args = tuple()
+                        actual_kwargs = {}
+
+                    if expect_call is not None:
+                        _, expect_args, expect_kwargs = expect_call
+                    else:
+                        expect_args = tuple()
+                        expect_kwargs = {}
+
+                    try:
+                        assert actual_args == expect_args
+                    except AssertionError as e_args:
+                        introspection += "\nArgs:\n" + str(e_args)
+                    try:
+                        assert actual_kwargs == expect_kwargs
+                    except AssertionError as e_kwargs:
+                        introspection += "\nKwargs:\n" + str(e_kwargs)
+                if introspection:
+                    msg += "\n\npytest introspection follows:\n" + 
introspection
+        e = AssertionError(msg)
+        e._mock_introspection_applied = True  # type:ignore[attr-defined]
+        raise e
+
+
 def wrap_assert_not_called(*args: Any, **kwargs: Any) -> None:
     __tracebackhide__ = True
     assert_wrapper(_mock_module_originals["assert_not_called"], *args, 
**kwargs)
@@ -489,7 +543,9 @@
 
 def wrap_assert_has_calls(*args: Any, **kwargs: Any) -> None:
     __tracebackhide__ = True
-    assert_wrapper(_mock_module_originals["assert_has_calls"], *args, **kwargs)
+    assert_has_calls_wrapper(
+        _mock_module_originals["assert_has_calls"], *args, **kwargs
+    )
 
 
 def wrap_assert_any_call(*args: Any, **kwargs: Any) -> None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/src/pytest_mock.egg-info/PKG-INFO 
new/pytest-mock-3.11.1/src/pytest_mock.egg-info/PKG-INFO
--- old/pytest-mock-3.10.0/src/pytest_mock.egg-info/PKG-INFO    2022-10-05 
20:52:39.000000000 +0200
+++ new/pytest-mock-3.11.1/src/pytest_mock.egg-info/PKG-INFO    2023-06-16 
01:57:01.000000000 +0200
@@ -1,11 +1,15 @@
 Metadata-Version: 2.1
 Name: pytest-mock
-Version: 3.10.0
+Version: 3.11.1
 Summary: Thin-wrapper around the mock package for easier use with pytest
 Home-page: https://github.com/pytest-dev/pytest-mock/
 Author: Bruno Oliveira
 Author-email: nicodde...@gmail.com
 License: MIT
+Project-URL: Documentation, https://pytest-mock.readthedocs.io/en/latest/
+Project-URL: Changelog, 
https://pytest-mock.readthedocs.io/en/latest/changelog.html
+Project-URL: Source, https://github.com/pytest-dev/pytest-mock/
+Project-URL: Tracker, https://github.com/pytest-dev/pytest-mock/issues
 Keywords: pytest mock
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
@@ -22,6 +26,7 @@
 Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Topic :: Software Development :: Testing
 Requires-Python: >=3.7
+Description-Content-Type: text/x-rst
 Provides-Extra: dev
 License-File: LICENSE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/tests/test_pytest_mock.py 
new/pytest-mock-3.11.1/tests/test_pytest_mock.py
--- old/pytest-mock-3.10.0/tests/test_pytest_mock.py    2022-10-05 
20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/tests/test_pytest_mock.py    2023-06-16 
01:56:41.000000000 +0200
@@ -419,7 +419,6 @@
         pass
 
     class Foo:
-
         __metaclass__ = MetaFoo
 
         @classmethod
@@ -631,6 +630,86 @@
         stub.assert_has_calls([mocker.call("bar")])
 
 
+def test_assert_has_calls_multiple_calls(mocker: MockerFixture) -> None:
+    stub = mocker.stub()
+    stub("foo")
+    stub("bar")
+    stub("baz")
+    stub.assert_has_calls([mocker.call("foo"), mocker.call("bar"), 
mocker.call("baz")])
+    with assert_traceback():
+        stub.assert_has_calls(
+            [
+                mocker.call("foo"),
+                mocker.call("bar"),
+                mocker.call("baz"),
+                mocker.call("bat"),
+            ]
+        )
+    with assert_traceback():
+        stub.assert_has_calls(
+            [mocker.call("foo"), mocker.call("baz"), mocker.call("bar")]
+        )
+
+
+def test_assert_has_calls_multiple_calls_subset(mocker: MockerFixture) -> None:
+    stub = mocker.stub()
+    stub("foo")
+    stub("bar")
+    stub("baz")
+    stub.assert_has_calls([mocker.call("bar"), mocker.call("baz")])
+    with assert_traceback():
+        stub.assert_has_calls([mocker.call("foo"), mocker.call("baz")])
+    with assert_traceback():
+        stub.assert_has_calls(
+            [mocker.call("foo"), mocker.call("bar"), mocker.call("bat")]
+        )
+    with assert_traceback():
+        stub.assert_has_calls([mocker.call("baz"), mocker.call("bar")])
+
+
+def test_assert_has_calls_multiple_calls_any_order(mocker: MockerFixture) -> 
None:
+    stub = mocker.stub()
+    stub("foo")
+    stub("bar")
+    stub("baz")
+    stub.assert_has_calls(
+        [mocker.call("foo"), mocker.call("baz"), mocker.call("bar")], 
any_order=True
+    )
+    with assert_traceback():
+        stub.assert_has_calls(
+            [
+                mocker.call("foo"),
+                mocker.call("baz"),
+                mocker.call("bar"),
+                mocker.call("bat"),
+            ],
+            any_order=True,
+        )
+
+
+def test_assert_has_calls_multiple_calls_any_order_subset(
+    mocker: MockerFixture,
+) -> None:
+    stub = mocker.stub()
+    stub("foo")
+    stub("bar")
+    stub("baz")
+    stub.assert_has_calls([mocker.call("baz"), mocker.call("foo")], 
any_order=True)
+    with assert_traceback():
+        stub.assert_has_calls(
+            [mocker.call("baz"), mocker.call("foo"), mocker.call("bat")], 
any_order=True
+        )
+
+
+def test_assert_has_calls_no_calls(
+    mocker: MockerFixture,
+) -> None:
+    stub = mocker.stub()
+    stub.assert_has_calls([])
+    with assert_traceback():
+        stub.assert_has_calls([mocker.call("foo")])
+
+
 def test_monkeypatch_ini(testdir: Any, mocker: MockerFixture) -> None:
     # Make sure the following function actually tests something
     stub = mocker.stub()
@@ -638,7 +717,6 @@
 
     testdir.makepyfile(
         """
-        import py.code
         def test_foo(mocker):
             stub = mocker.stub()
             assert stub.assert_called_with.__module__ == stub.__module__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-mock-3.10.0/tox.ini 
new/pytest-mock-3.11.1/tox.ini
--- old/pytest-mock-3.10.0/tox.ini      2022-10-05 20:52:25.000000000 +0200
+++ new/pytest-mock-3.11.1/tox.ini      2023-06-16 01:56:41.000000000 +0200
@@ -3,7 +3,6 @@
 envlist = py{37,38,39,310,311}, norewrite
 
 [testenv]
-passenv = USER USERNAME
 deps =
     coverage
     mock

Reply via email to