From 1e19c946b24b760dbdddbf7f30a8b3bc23c8aada Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:54:41 +0000 Subject: [PATCH 1/2] Bump actions/download-artifact from 7 to 8 in the github-actions group Bumps the github-actions group with 1 update: [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/download-artifact` from 7 to 8 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7f85609..1158377 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v6 - name: Download Package - uses: actions/download-artifact@v7 + uses: actions/download-artifact@v8 with: name: Packages path: dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9cc7d1e..ef2b68a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v6 - name: Download Package - uses: actions/download-artifact@v7 + uses: actions/download-artifact@v8 with: name: Packages path: dist From 61872e94c1c1f08c0d1b3fafd524314458a08874 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 16 Mar 2026 18:14:04 -0300 Subject: [PATCH 2/2] Workaround for testdir.syspathinsert requiring pkg_resources `setuptools` no longer vendors `pkg_resources`. Use a simple workaround instead, which we can remove once we drop pytest 6 support. --- tests/test_pytest_mock.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py index 79d59e1..7be5729 100644 --- a/tests/test_pytest_mock.py +++ b/tests/test_pytest_mock.py @@ -28,6 +28,16 @@ NEWEST_FORMATTING = sys.version_info >= (3, 11, 7) +def syspath_insert_workaround(request: pytest.FixtureRequest, testdir: Any) -> None: + if pytest.__version__.split(".")[0] == "6": + # Avoid testdir.syspathinsert() which requires pkg_resources (setuptools) in + # pytest 6.2.5; insert directly instead (#169). + sys.path.insert(0, str(testdir.tmpdir)) + request.addfinalizer(lambda: sys.path.remove(str(testdir.tmpdir))) + else: + testdir.syspathinsert() + + @pytest.fixture def needs_assert_rewrite(pytestconfig): """ @@ -517,7 +527,9 @@ class Foo(Base): assert spy.spy_return_list == [20] -def test_callable_like_spy(testdir: Any, mocker: MockerFixture) -> None: +def test_callable_like_spy( + testdir: Any, mocker: MockerFixture, request: pytest.FixtureRequest +) -> None: testdir.makepyfile( uut=""" class CallLike(object): @@ -527,7 +539,7 @@ def __call__(self, x): call_like = CallLike() """ ) - testdir.syspathinsert() + syspath_insert_workaround(request, testdir) uut = __import__("uut") @@ -1158,7 +1170,7 @@ def doIt(self): assert len(warn_record) == 0 -def test_abort_patch_context_manager_with_stale_pyc(testdir: Any) -> None: +def test_abort_patch_context_manager_with_stale_pyc(testdir: Any, request: Any) -> None: """Ensure we don't trigger an error in case the frame where mocker.patch is being used doesn't have a 'context' (#169)""" import compileall @@ -1173,7 +1185,7 @@ def check(mocker): assert C.x == 2 """ ) - testdir.syspathinsert() + syspath_insert_workaround(request, testdir) testdir.makepyfile( """