Skip to content

Commit 4d45401

Browse files
committed
Fix mypy plugin compatibility and test infrastructure for CI
- Fix mypy plugin analyze_member_access call compatibility with mypy 1.15.0 - Add pytest-asyncio dependency for proper async test execution - Register asyncio marker in pytest configuration - Fix hypothesis test import issues with health check suppression
1 parent 7498e44 commit 4d45401

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

poetry.lock

Lines changed: 22 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ pytest-mypy-plugins = "^3.1"
7373
pytest-subtests = "^0.14"
7474
pytest-shard = "^0.1"
7575
covdefaults = "^2.3"
76+
pytest-asyncio = "^1.0.0"
7677

7778
[tool.poetry.group.docs]
7879
optional = true

returns/contrib/mypy/_features/kind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def attribute_access(ctx: AttributeContext) -> MypyType:
6969
is_lvalue=False,
7070
is_super=False,
7171
is_operator=False,
72-
msg=ctx.api.msg,
72+
msg=exprchecker.msg,
7373
original_type=instance,
7474
chk=ctx.api, # type: ignore
7575
in_literal_context=exprchecker.is_literal_context(),

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ addopts =
106106
# pytest-mypy-plugin:
107107
--mypy-ini-file=setup.cfg
108108

109+
# Registered markers:
110+
markers =
111+
asyncio: mark test as asynchronous
112+
109113
# Ignores some warnings inside:
110114
filterwarnings =
111115
ignore:coroutine '\w+' was never awaited:RuntimeWarning
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Empty init file for test module
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
from hypothesis import HealthCheck
12
from hypothesis import strategies as st
2-
from test_hypothesis.test_laws import test_custom_type_applicative
33

44
from returns.contrib.hypothesis.laws import check_all_laws
55

6+
from . import test_custom_type_applicative # noqa: WPS300
7+
68
container_type = test_custom_type_applicative._Wrapper # noqa: SLF001
79

810
check_all_laws(
911
container_type,
1012
container_strategy=st.builds(container_type, st.integers()),
13+
settings_kwargs={'suppress_health_check': [HealthCheck.too_slow]},
1114
)

0 commit comments

Comments
 (0)