Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions mypyc/test-data/run-misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,6 @@ elif sys.version_info[:2] == (3, 11):
elif sys.version_info[:2] == (3, 10):
def version() -> int:
return 10
elif sys.version_info[:2] == (3, 9):
def version() -> int:
return 9
else:
raise Exception("we don't support this version yet!")

Expand Down
21 changes: 0 additions & 21 deletions test-data/unit/check-dataclasses.test
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ class Application:
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnly]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass(kw_only=True)
Expand All @@ -398,7 +397,6 @@ Application(rating='name', name=123) # E: Argument "rating" to "Application" has
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyOnField]
# flags: --python-version 3.10
from dataclasses import dataclass, field

@dataclass
Expand All @@ -417,7 +415,6 @@ Application(123, rating='name') # E: Argument 1 to "Application" has incompatibl
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyOnFieldFalse]
# flags: --python-version 3.10
from dataclasses import dataclass, field

@dataclass
Expand All @@ -434,7 +431,6 @@ Application('name') # E: Too few arguments for "Application"
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyWithSentinel]
# flags: --python-version 3.10
from dataclasses import dataclass, KW_ONLY

@dataclass
Expand All @@ -453,7 +449,6 @@ Application('name', rating=123) # E: Too many positional arguments for "Applica
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyWithSentinelAndFieldOverride]
# flags: --python-version 3.10
from dataclasses import dataclass, field, KW_ONLY

@dataclass
Expand All @@ -473,7 +468,6 @@ Application(123, rating=123) # E: "Application" gets multiple values for keywor
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyWithSentinelAndSubclass]
# flags: --python-version 3.10
from dataclasses import dataclass, field, KW_ONLY

@dataclass
Expand All @@ -500,7 +494,6 @@ D(123, False) # E: Argument 1 to "D" has incompatible type "int"; expected "str
[builtins fixtures/dataclasses.pyi]

[case testDataclassesOrderingKwOnlyWithMultipleSentinel]
# flags: --python-version 3.10
from dataclasses import dataclass, field, KW_ONLY

@dataclass
Expand Down Expand Up @@ -1427,7 +1420,6 @@ reveal_type(Foo(bar=1.5)) # N: Revealed type is "__main__.Foo"
[typing fixtures/typing-typeddict.pyi]

[case testDataclassWithSlotsArg]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass(slots=True)
Expand All @@ -1443,7 +1435,6 @@ class Some:
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithSlotsDef]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass(slots=False)
Expand All @@ -1460,7 +1451,6 @@ class Some:
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithSlotsDerivedFromNonSlot]
# flags: --python-version 3.10
from dataclasses import dataclass

class A:
Expand All @@ -1476,7 +1466,6 @@ class B(A):
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithSlotsConflict]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass(slots=True)
Expand All @@ -1498,7 +1487,6 @@ class DynamicDef: # E: "DynamicDef" both defines "__slots__" and is used with "
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithSlotsRuntimeAttr]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass(slots=True)
Expand Down Expand Up @@ -1527,7 +1515,6 @@ NoSlots.__slots__ # E: "type[NoSlots]" has no attribute "__slots__"


[case testSlotsDefinitionWithTwoPasses1]
# flags: --python-version 3.10
# https://github.com/python/mypy/issues/11821
from typing import TypeVar, Protocol, Generic
from dataclasses import dataclass
Expand All @@ -1545,7 +1532,6 @@ class Node(Generic[V]): # Error was here
[builtins fixtures/dataclasses.pyi]

[case testSlotsDefinitionWithTwoPasses2]
# flags: --python-version 3.10
from typing import TypeVar, Protocol, Generic
from dataclasses import dataclass

Expand All @@ -1563,7 +1549,6 @@ class Node(Generic[V]): # E: "Node" both defines "__slots__" and is used with "
[builtins fixtures/dataclasses.pyi]

[case testSlotsDefinitionWithTwoPasses3]
# flags: --python-version 3.10
from typing import TypeVar, Protocol, Generic
from dataclasses import dataclass

Expand All @@ -1581,7 +1566,6 @@ class Node(Generic[V]): # E: "Node" both defines "__slots__" and is used with "
[builtins fixtures/dataclasses.pyi]

[case testSlotsDefinitionWithTwoPasses4]
# flags: --python-version 3.10
import dataclasses as dtc

PublishedMessagesVar = dict[int, 'PublishedMessages']
Expand All @@ -1592,7 +1576,6 @@ class PublishedMessages:
[builtins fixtures/dataclasses.pyi]

[case testDataclassSlotsWithDeferredBase]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass
Expand Down Expand Up @@ -1653,7 +1636,6 @@ def foo() -> None:
[builtins fixtures/dataclasses.pyi]

[case testDataclassesMultipleInheritanceWithNonDataclass]
# flags: --python-version 3.10
from dataclasses import dataclass

@dataclass
Expand Down Expand Up @@ -1828,7 +1810,6 @@ class MyClass(MyGeneric[MyDataclass]): ...
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithMatchArgs]
# flags: --python-version 3.10
from dataclasses import dataclass
@dataclass
class One:
Expand All @@ -1849,7 +1830,6 @@ reveal_type(e.__match_args__) # N: Revealed type is "tuple[()]"
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithMatchArgsAndKwOnly]
# flags: --python-version 3.10
from dataclasses import dataclass, field
@dataclass(kw_only=True)
class One:
Expand All @@ -1865,7 +1845,6 @@ reveal_type(Two.__match_args__) # N: Revealed type is "tuple[Literal['a']]"
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithoutMatchArgs]
# flags: --python-version 3.10
from dataclasses import dataclass
@dataclass(match_args=False)
class One:
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-generic-alias.test
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ t23: collections.abc.ValuesView[str]
[builtins fixtures/tuple.pyi]

[case testGenericAliasIsinstanceUnreachable]
# flags: --warn-unreachable --python-version 3.10
# flags: --warn-unreachable
from collections.abc import Iterable

class A: ...
Expand All @@ -165,7 +165,7 @@ def test(dependencies: list[A] | None) -> None:
[typing fixtures/typing-full.pyi]

[case testGenericAliasRedundantExprCompoundIfExpr]
# flags: --warn-unreachable --enable-error-code=redundant-expr --python-version 3.10
# flags: --warn-unreachable --enable-error-code=redundant-expr

from typing import Any, reveal_type
from collections.abc import Iterable
Expand Down
13 changes: 6 additions & 7 deletions test-data/unit/check-generic-subtyping.test
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,6 @@ main:15: error: Item "V" of the upper bound "U | V | W" of type variable "T" has


[case testTypeVarBoundToNewUnionAttributeAccess]
# flags: --python-version 3.10
from typing import TypeVar

class U:
Expand All @@ -891,12 +890,12 @@ def f(x: T) -> None:

[builtins fixtures/tuple.pyi]
[out]
main:14: error: Item "V" of the upper bound "U | V | W" of type variable "T" has no attribute "a"
main:14: error: Item "W" of the upper bound "U | V | W" of type variable "T" has no attribute "a"
main:15: error: Item "U" of the upper bound "U | V | W" of type variable "T" has no attribute "b"
main:15: error: Item "W" of the upper bound "U | V | W" of type variable "T" has no attribute "b"
main:16: error: Item "U" of the upper bound "U | V | W" of type variable "T" has no attribute "c"
main:16: error: Item "V" of the upper bound "U | V | W" of type variable "T" has no attribute "c"
main:13: error: Item "V" of the upper bound "U | V | W" of type variable "T" has no attribute "a"
main:13: error: Item "W" of the upper bound "U | V | W" of type variable "T" has no attribute "a"
main:14: error: Item "U" of the upper bound "U | V | W" of type variable "T" has no attribute "b"
main:14: error: Item "W" of the upper bound "U | V | W" of type variable "T" has no attribute "b"
main:15: error: Item "U" of the upper bound "U | V | W" of type variable "T" has no attribute "c"
main:15: error: Item "V" of the upper bound "U | V | W" of type variable "T" has no attribute "c"


[case testSubtypingIterableUnpacking1]
Expand Down
1 change: 0 additions & 1 deletion test-data/unit/check-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -7055,7 +7055,6 @@ def guard(x: object) -> TypeIs[int]:
[builtins fixtures/tuple.pyi]

[case testStartUsingPEP604Union]
# flags: --python-version 3.10
import a
[file a.py]
import lib
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-inference.test
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,7 @@ if x:
[builtins fixtures/dict.pyi]

[case testAllowPlainNoneForPartialAtModuleScope]
# flags: --local-partial-types --python-version 3.10
# flags: --local-partial-types
x = None
reveal_type(x) # N: Revealed type is "None"

Expand Down
1 change: 0 additions & 1 deletion test-data/unit/check-namedtuple.test
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,6 @@ def f(fields) -> None:
[builtins fixtures/tuple.pyi]

[case testNamedTupleHasMatchArgs]
# flags: --python-version 3.10
from typing import NamedTuple
class One(NamedTuple):
bar: int
Expand Down
12 changes: 6 additions & 6 deletions test-data/unit/check-narrowing.test
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ else:


[case testNarrowingWithTupleOfTypesPy310Plus]
# flags: --python-version 3.10 --strict-equality --warn-unreachable
# flags: --strict-equality --warn-unreachable
class Base: ...

class Impl1(Base): ...
Expand Down Expand Up @@ -2373,7 +2373,7 @@ def f(cls: Type[Union[None, int]]) -> None:
[builtins fixtures/isinstance.pyi]

[case testNarrowingIsSubclassNoneType4]
# flags: --python-version 3.10 --strict-equality --warn-unreachable
# flags: --strict-equality --warn-unreachable

from types import NoneType
from typing import Type, Union
Expand All @@ -2386,7 +2386,7 @@ def f(cls: Type[Union[None, int]]) -> None:
[builtins fixtures/isinstance.pyi]

[case testNarrowingIsInstanceNoIntersectionWithFinalTypeAndNoneType]
# flags: --warn-unreachable --python-version 3.10 --strict-equality
# flags: --warn-unreachable --strict-equality

from types import NoneType
from typing import final
Expand Down Expand Up @@ -2620,7 +2620,7 @@ def foo(location: ParameterLocation):
[builtins fixtures/primitives.pyi]

[case testConsistentNarrowingEqAndIn]
# flags: --python-version 3.10 --strict-equality --warn-unreachable
# flags: --strict-equality --warn-unreachable

# https://github.com/python/mypy/issues/17864
def f(x: str | int) -> None:
Expand All @@ -2636,7 +2636,7 @@ def f(x: str | int) -> None:
[builtins fixtures/primitives.pyi]

[case testConsistentNarrowingEqAndInWithCustomEq]
# flags: --python-version 3.10 --strict-equality --warn-unreachable
# flags: --strict-equality --warn-unreachable

# https://github.com/python/mypy/issues/17864
class C:
Expand Down Expand Up @@ -3063,7 +3063,7 @@ reveal_type(t.foo) # N: Revealed type is "__main__.C"
[builtins fixtures/property.pyi]

[case testNarrowingNotImplemented]
# flags: --python-version 3.10 --warn-unreachable
# flags: --warn-unreachable
from __future__ import annotations
import types

Expand Down
1 change: 0 additions & 1 deletion test-data/unit/check-parameter-specification.test
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ reveal_type(whatever(217)) # N: Revealed type is "builtins.list[builtins.int]"
[builtins fixtures/paramspec.pyi]

[case testInvalidParamSpecType]
# flags: --python-version 3.10
from typing import ParamSpec

P = ParamSpec("P")
Expand Down
6 changes: 0 additions & 6 deletions test-data/unit/check-plugin-attrs.test
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,6 @@ NoSlots.__slots__ # E: "type[NoSlots]" has no attribute "__slots__"
[builtins fixtures/plugin_attrs.pyi]

[case testAttrsWithMatchArgs]
# flags: --python-version 3.10
import attr

@attr.s(match_args=True, auto_attribs=True)
Expand All @@ -1804,7 +1803,6 @@ reveal_type(ToMatch(1, 2, z=3).__match_args__) # N: Revealed type is "tuple
[builtins fixtures/plugin_attrs.pyi]

[case testAttrsWithMatchArgsDefaultCase]
# flags: --python-version 3.10
import attr

@attr.s(auto_attribs=True)
Expand All @@ -1825,7 +1823,6 @@ reveal_type(t2.__match_args__) # N: Revealed type is "tuple[Literal['x']?, Lite
[builtins fixtures/plugin_attrs.pyi]

[case testAttrsWithMatchArgsOverrideExisting]
# flags: --python-version 3.10
import attr
from typing import Final

Expand All @@ -1848,7 +1845,6 @@ reveal_type(WithoutMatch(x=1, y=2).__match_args__) # N: Revealed type is "tuple
[builtins fixtures/plugin_attrs.pyi]

[case testAttrsMultipleInheritance]
# flags: --python-version 3.10
import attr

@attr.s
Expand Down Expand Up @@ -2169,7 +2165,6 @@ reveal_type(a2) # N: Revealed type is "__main__.A[builtins.int]"
[builtins fixtures/plugin_attrs.pyi]

[case testEvolveUnion]
# flags: --python-version 3.10
from typing import Generic, TypeVar
import attrs

Expand Down Expand Up @@ -2199,7 +2194,6 @@ a2 = attrs.evolve(a_or_b, x=42, y=True, w={}) # E: Argument "w" to "evolve" of
[builtins fixtures/plugin_attrs.pyi]

[case testEvolveUnionOfTypeVar]
# flags: --python-version 3.10
import attrs
from typing import TypeVar

Expand Down
1 change: 0 additions & 1 deletion test-data/unit/check-type-aliases.test
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@ c.SpecialExplicit = 4
[typing fixtures/typing-medium.pyi]

[case testNewStyleUnionInTypeAliasWithMalformedInstance]
# flags: --python-version 3.10
from typing import List

A = List[int, str] | int # E: "list" expects 1 type argument, but 2 given
Expand Down
Loading
Loading