Skip to content

Commit 6f5dd2b

Browse files
Bump actions/download-artifact from 7 to 8 in the github-actions group (#564)
* 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](actions/download-artifact@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] <support@github.com> * 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. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2 parents 0fdb1a2 + 61872e9 commit 6f5dd2b

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- uses: actions/checkout@v6
4141

4242
- name: Download Package
43-
uses: actions/download-artifact@v7
43+
uses: actions/download-artifact@v8
4444
with:
4545
name: Packages
4646
path: dist

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v6
5656

5757
- name: Download Package
58-
uses: actions/download-artifact@v7
58+
uses: actions/download-artifact@v8
5959
with:
6060
name: Packages
6161
path: dist

tests/test_pytest_mock.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
NEWEST_FORMATTING = sys.version_info >= (3, 11, 7)
2929

3030

31+
def syspath_insert_workaround(request: pytest.FixtureRequest, testdir: Any) -> None:
32+
if pytest.__version__.split(".")[0] == "6":
33+
# Avoid testdir.syspathinsert() which requires pkg_resources (setuptools) in
34+
# pytest 6.2.5; insert directly instead (#169).
35+
sys.path.insert(0, str(testdir.tmpdir))
36+
request.addfinalizer(lambda: sys.path.remove(str(testdir.tmpdir)))
37+
else:
38+
testdir.syspathinsert()
39+
40+
3141
@pytest.fixture
3242
def needs_assert_rewrite(pytestconfig):
3343
"""
@@ -517,7 +527,9 @@ class Foo(Base):
517527
assert spy.spy_return_list == [20]
518528

519529

520-
def test_callable_like_spy(testdir: Any, mocker: MockerFixture) -> None:
530+
def test_callable_like_spy(
531+
testdir: Any, mocker: MockerFixture, request: pytest.FixtureRequest
532+
) -> None:
521533
testdir.makepyfile(
522534
uut="""
523535
class CallLike(object):
@@ -527,7 +539,7 @@ def __call__(self, x):
527539
call_like = CallLike()
528540
"""
529541
)
530-
testdir.syspathinsert()
542+
syspath_insert_workaround(request, testdir)
531543

532544
uut = __import__("uut")
533545

@@ -1158,7 +1170,7 @@ def doIt(self):
11581170
assert len(warn_record) == 0
11591171

11601172

1161-
def test_abort_patch_context_manager_with_stale_pyc(testdir: Any) -> None:
1173+
def test_abort_patch_context_manager_with_stale_pyc(testdir: Any, request: Any) -> None:
11621174
"""Ensure we don't trigger an error in case the frame where mocker.patch is being
11631175
used doesn't have a 'context' (#169)"""
11641176
import compileall
@@ -1173,7 +1185,7 @@ def check(mocker):
11731185
assert C.x == 2
11741186
"""
11751187
)
1176-
testdir.syspathinsert()
1188+
syspath_insert_workaround(request, testdir)
11771189

11781190
testdir.makepyfile(
11791191
"""

0 commit comments

Comments
 (0)