Skip to content

Commit 6b02b35

Browse files
authored
Merge pull request #743 from pytest-dev/pre-commit-ci-update-config
2 parents f9f8a76 + 1814327 commit 6b02b35

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
language: python
3030
additional_dependencies: [pygments, restructuredtext_lint]
3131
- repo: https://github.com/pre-commit/mirrors-mypy
32-
rev: v0.910-1
32+
rev: v0.920
3333
hooks:
3434
- id: mypy
3535
files: ^(src/|testing/)

testing/acceptance_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def test_skip():
154154
result.stdout.fnmatch_lines(["*2*Python*", "*2 failed, 1 passed, 1 skipped*"])
155155
assert result.ret == 1
156156

157-
@pytest.mark.xfail("sys.platform.startswith('java')", run=False)
158157
def test_dist_tests_with_crash(self, pytester: pytest.Pytester) -> None:
159158
if not hasattr(os, "kill"):
160159
pytest.skip("no os.kill")

testing/test_looponfail.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import cast
2+
13
import py
24
import pytest
35
import shutil
@@ -123,7 +125,7 @@ def test_failures_somewhere(self, pytester: pytest.Pytester) -> None:
123125
failures = control.runsession()
124126
assert failures
125127
control.setup()
126-
item_path = item.path if PYTEST_GTE_7 else Path(item.fspath) # type: ignore[attr-defined]
128+
item_path = item.path if PYTEST_GTE_7 else Path(cast(py.path.local, item.fspath)) # type: ignore[attr-defined]
127129
item_path.write_text("def test_func():\n assert 1\n")
128130
removepyc(item_path)
129131
topdir, failures = control.runsession()[:2]
@@ -141,7 +143,11 @@ def test_func():
141143
control = RemoteControl(modcol.config)
142144
control.loop_once()
143145
assert control.failures
144-
modcol_path = modcol.path if PYTEST_GTE_7 else Path(modcol.fspath) # type: ignore[attr-defined]
146+
if PYTEST_GTE_7:
147+
modcol_path = modcol.path # type:ignore[attr-defined]
148+
else:
149+
modcol_path = Path(cast(py.path.local, modcol.fspath))
150+
145151
modcol_path.write_text(
146152
textwrap.dedent(
147153
"""
@@ -173,7 +179,7 @@ def test_func():
173179
if PYTEST_GTE_7:
174180
parent = modcol.path.parent.parent # type: ignore[attr-defined]
175181
else:
176-
parent = Path(modcol.fspath.dirpath().dirpath())
182+
parent = Path(cast(py.path.local, modcol.fspath).dirpath().dirpath())
177183
monkeypatch.chdir(parent)
178184
modcol.config.args = [
179185
str(Path(x).relative_to(parent)) for x in modcol.config.args

0 commit comments

Comments
 (0)