Skip to content

Commit 21a4b58

Browse files
committed
Fix mypy plugin compatibility and test infrastructure for CI
Update mypy plugin compatibility and fix noqa comment ordering in test_result_equality.py for consistency with project linting standards.
1 parent 7498e44 commit 21a4b58

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
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
)

tests/test_result/test_result_equality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_immutability_failure():
5454
Failure(1).missing = 2
5555

5656
with pytest.raises(ImmutableStateError):
57-
del Failure(0)._inner_state # type: ignore # noqa: WPS420, SLF001
57+
del Failure(0)._inner_state # type: ignore # noqa: SLF001, WPS420
5858

5959
with pytest.raises(AttributeError):
6060
Failure(1).missing # type: ignore # noqa: B018
@@ -69,7 +69,7 @@ def test_immutability_success():
6969
Success(1).missing = 2
7070

7171
with pytest.raises(ImmutableStateError):
72-
del Success(0)._inner_state # type: ignore # noqa: WPS420, SLF001
72+
del Success(0)._inner_state # type: ignore # noqa: SLF001, WPS420
7373

7474
with pytest.raises(AttributeError):
7575
Success(1).missing # type: ignore # noqa: B018

0 commit comments

Comments
 (0)