Skip to content

Commit

Permalink
fix typecheck again
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Oct 21, 2024
1 parent 6f1baec commit a373e61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 3 additions & 9 deletions whole_repo_tests/test_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def test_stateful_bundle_generic_type(tmp_path):
f.write_text(
"from hypothesis.stateful import Bundle\n"
"b: Bundle[int] = Bundle('test')\n"
"reveal_type(b.example())\n",
"x = b.example()\n"
"reveal_type(x)\n",
encoding="utf-8",
)
got = get_mypy_analysed_type(f)
Expand Down Expand Up @@ -564,14 +565,7 @@ def test_bar(x: str) -> None:
assert_mypy_errors(f, [], python_version=python_version)


@pytest.mark.parametrize(
"python_version",
[
# FIXME: temporary workaround for mypy bug, see hypothesis/pull/4136
pytest.param(v, marks=[pytest.mark.xfail(strict=False)] * (v == "3.13"))
for v in PYTHON_VERSIONS
],
)
@pytest.mark.parametrize("python_version", PYTHON_VERSIONS)
def test_given_only_allows_strategies(tmp_path, python_version):
f = tmp_path / "check_mypy_given_expects_strategies.py"
f.write_text(
Expand Down
9 changes: 8 additions & 1 deletion whole_repo_tests/test_pyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ def test_bar(x: str):
assert _get_pyright_errors(file) == []


@pytest.mark.parametrize("python_version", PYTHON_VERSIONS)
@pytest.mark.parametrize(
"python_version",
[
# FIXME: temporary workaround, see hypothesis/pull/4136
pytest.param(v, marks=[pytest.mark.xfail(strict=False)] * (v == "3.13"))
for v in PYTHON_VERSIONS
],
)
def test_given_only_allows_strategies(tmp_path: Path, python_version: str):
file = tmp_path / "test.py"
file.write_text(
Expand Down

0 comments on commit a373e61

Please sign in to comment.