From 82ecdea0c2b9ed0fa0d6b00828eb5e0e8410caf5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 20:42:50 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.920](https://github.com/pre-commit/mirrors-mypy/compare/v0.910-1...v0.920) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 492dbc6..3ac4ba3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: language: python additional_dependencies: [pygments, restructuredtext_lint] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910-1 + rev: v0.920 hooks: - id: mypy files: ^(src/|testing/) From d21f59fea72d2fe5c60db0f7d1def2a06c053451 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 27 Dec 2021 08:05:01 -0300 Subject: [PATCH 2/3] Fix typing errors after updating mypy --- testing/test_looponfail.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/testing/test_looponfail.py b/testing/test_looponfail.py index 02a1f59..cd1cc43 100644 --- a/testing/test_looponfail.py +++ b/testing/test_looponfail.py @@ -1,3 +1,5 @@ +from typing import cast + import py import pytest import shutil @@ -123,7 +125,7 @@ class TestRemoteControl: failures = control.runsession() assert failures control.setup() - item_path = item.path if PYTEST_GTE_7 else Path(item.fspath) # type: ignore[attr-defined] + item_path = item.path if PYTEST_GTE_7 else Path(cast(py.path.local, item.fspath)) # type: ignore[attr-defined] item_path.write_text("def test_func():\n assert 1\n") removepyc(item_path) topdir, failures = control.runsession()[:2] @@ -141,7 +143,11 @@ class TestRemoteControl: control = RemoteControl(modcol.config) control.loop_once() assert control.failures - modcol_path = modcol.path if PYTEST_GTE_7 else Path(modcol.fspath) # type: ignore[attr-defined] + if PYTEST_GTE_7: + modcol_path = modcol.path # type:ignore[attr-defined] + else: + modcol_path = Path(cast(py.path.local, modcol.fspath)) + modcol_path.write_text( textwrap.dedent( """ @@ -173,7 +179,7 @@ class TestRemoteControl: if PYTEST_GTE_7: parent = modcol.path.parent.parent # type: ignore[attr-defined] else: - parent = Path(modcol.fspath.dirpath().dirpath()) + parent = Path(cast(py.path.local, modcol.fspath).dirpath().dirpath()) monkeypatch.chdir(parent) modcol.config.args = [ str(Path(x).relative_to(parent)) for x in modcol.config.args From 18143275c63a5d2ceb54afebbb944dbc0e7ac9f1 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 27 Dec 2021 08:05:46 -0300 Subject: [PATCH 3/3] Remove obsolete skip based on java (no longer supported) --- testing/acceptance_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index dee1848..44443d0 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -154,7 +154,6 @@ class TestDistribution: result.stdout.fnmatch_lines(["*2*Python*", "*2 failed, 1 passed, 1 skipped*"]) assert result.ret == 1 - @pytest.mark.xfail("sys.platform.startswith('java')", run=False) def test_dist_tests_with_crash(self, pytester: pytest.Pytester) -> None: if not hasattr(os, "kill"): pytest.skip("no os.kill")