Skip to content

Commit 6a02efd

Browse files
authored
Fix mypy tests (#1444)
Also remove lower pins in dev groups since we fully lock anyways.
1 parent 913f818 commit 6a02efd

File tree

3 files changed

+138
-143
lines changed

3 files changed

+138
-143
lines changed

pyproject.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,18 @@ Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-att
3737

3838

3939
[dependency-groups]
40-
tests-mypy = [
41-
# A transitive dependency of pytest-mypy-plugins doesn't build on 3.14 yet.
42-
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10" and python_version < "3.14"',
43-
# Since the mypy error messages keep changing, we have to keep updating this
44-
# pin.
45-
'mypy>=1.11.1; platform_python_implementation == "CPython" and python_version >= "3.10"',
46-
]
40+
tests-mypy = ['pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10"']
4741
tests = [
4842
{ include-group = "tests-mypy" },
4943
# For regression test to ensure cloudpickle compat doesn't break.
5044
'cloudpickle; platform_python_implementation == "CPython"',
5145
"hypothesis",
5246
"pympler",
53-
# 4.3.0 dropped last use of `convert`
54-
"pytest>=4.3.0",
47+
"pytest",
5548
]
5649
cov = [
5750
{ include-group = "tests" },
58-
# Ensure coverage is new enough for `source_pkgs`.
59-
"coverage[toml]>=5.3",
51+
"coverage[toml]",
6052
]
6153
pyright = ["pyright", { include-group = "tests" }]
6254
benchmark = [

tests/test_mypy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@
604604
parent: Optional[A]
605605
606606
reveal_type(A) # N: Revealed type is "def (parent: main.B) -> main.A"
607-
reveal_type(B) # N: Revealed type is "def (parent: Union[main.A, None]) -> main.B"
607+
reveal_type(B) # N: Revealed type is "def (parent: main.A | None) -> main.B"
608608
A(B(None))
609609
610610
- case: testAttrsForwardReferenceInClass
@@ -620,7 +620,7 @@
620620
parent: Optional[A]
621621
622622
reveal_type(A) # N: Revealed type is "def (parent: main.A.B) -> main.A"
623-
reveal_type(A.B) # N: Revealed type is "def (parent: Union[main.A, None]) -> main.A.B"
623+
reveal_type(A.B) # N: Revealed type is "def (parent: main.A | None) -> main.A.B"
624624
A(A.B(None))
625625
626626
- case: testAttrsImporting
@@ -739,7 +739,7 @@
739739
740740
AOrB = Union[A, B]
741741
742-
reveal_type(A) # N: Revealed type is "def (frob: builtins.list[Union[main.A, main.B]]) -> main.A"
742+
reveal_type(A) # N: Revealed type is "def (frob: builtins.list[main.A | main.B]) -> main.A"
743743
reveal_type(B) # N: Revealed type is "def () -> main.B"
744744
745745
A([B()])

0 commit comments

Comments
 (0)