Skip to content

Commit

Permalink
Added tests for TypeAliasType.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictraut committed Dec 28, 2023
1 parent 5e10e0b commit ca01411
Show file tree
Hide file tree
Showing 14 changed files with 318 additions and 78 deletions.
88 changes: 45 additions & 43 deletions conformance/results/mypy/aliases_type_statement.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ aliases_type_statement.py:9: error: Name "S2" is not defined [name-defined]
aliases_type_statement.py:10: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:10: error: Value of type "UnionType" is not indexable [index]
aliases_type_statement.py:14: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:33: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:34: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:35: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:36: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:21: error: "type[int]" has no attribute "__value__" [attr-defined]
aliases_type_statement.py:23: error: "type[int]" has no attribute "other_attrib" [attr-defined]
aliases_type_statement.py:37: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:38: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:39: error: PEP 695 type aliases are not yet supported [valid-type]
Expand All @@ -24,51 +22,55 @@ aliases_type_statement.py:41: error: PEP 695 type aliases are not yet supported
aliases_type_statement.py:42: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:43: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:44: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:44: error: Function "list" could always be true in boolean context [truthy-function]
aliases_type_statement.py:45: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:46: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:47: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:48: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:50: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:48: error: Function "list" could always be true in boolean context [truthy-function]
aliases_type_statement.py:49: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:52: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:54: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:60: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:60: error: Name "K" is not defined [name-defined]
aliases_type_statement.py:65: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:68: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:68: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:68: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:68: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:70: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:71: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:73: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:73: error: Name "P" is not defined [name-defined]
aliases_type_statement.py:73: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:73: error: Name "S" is not defined [name-defined]
aliases_type_statement.py:73: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:73: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:75: error: Unexpected "..." [misc]
aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:58: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:64: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:64: error: Name "K" is not defined [name-defined]
aliases_type_statement.py:69: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:72: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:72: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:72: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:74: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:75: error: Variable "aliases_type_statement.RecursiveTypeAlias1" is not valid as a type [valid-type]
aliases_type_statement.py:75: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:76: error: Unexpected "..." [misc]
aliases_type_statement.py:76: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:76: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:77: error: Unexpected "..." [misc]
aliases_type_statement.py:77: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:77: error: Name "P" is not defined [name-defined]
aliases_type_statement.py:77: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:77: error: Name "S" is not defined [name-defined]
aliases_type_statement.py:77: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:77: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:78: error: Bracketed expression "[...]" is not valid as a type [valid-type]
aliases_type_statement.py:78: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:78: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:80: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:80: error: Name "RecursiveTypeAlias3" is not defined [name-defined]
aliases_type_statement.py:82: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:82: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:82: error: Cannot determine type of "RecursiveTypeAlias4" [has-type]
aliases_type_statement.py:79: error: Unexpected "..." [misc]
aliases_type_statement.py:79: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:80: error: Unexpected "..." [misc]
aliases_type_statement.py:80: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:81: error: Unexpected "..." [misc]
aliases_type_statement.py:81: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:82: error: Bracketed expression "[...]" is not valid as a type [valid-type]
aliases_type_statement.py:82: error: Variable "aliases_type_statement.RecursiveTypeAlias2" is not valid as a type [valid-type]
aliases_type_statement.py:82: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:84: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:84: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:84: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type]
aliases_type_statement.py:84: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:84: error: Name "RecursiveTypeAlias3" is not defined [name-defined]
aliases_type_statement.py:86: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:86: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]
aliases_type_statement.py:86: error: Name "RecursiveTypeAlias7" is used before definition [used-before-def]
aliases_type_statement.py:87: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:86: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:86: error: Cannot determine type of "RecursiveTypeAlias4" [has-type]
aliases_type_statement.py:88: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:88: error: Name "T" is not defined [name-defined]
aliases_type_statement.py:88: error: Variable "aliases_type_statement.RecursiveTypeAlias5" is not valid as a type [valid-type]
aliases_type_statement.py:88: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_type_statement.py:90: error: PEP 695 type aliases are not yet supported [valid-type]
aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]
aliases_type_statement.py:90: error: Name "RecursiveTypeAlias7" is used before definition [used-before-def]
aliases_type_statement.py:91: error: PEP 695 type aliases are not yet supported [valid-type]
"""
57 changes: 57 additions & 0 deletions conformance/results/mypy/aliases_typealiastype.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
conformant = "Unsupported"
notes = """
Support for TypeAliasType is not implemented.
"""
output = """
aliases_typealiastype.py:17: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]
aliases_typealiastype.py:17: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
aliases_typealiastype.py:17: note: (Hint: Use "T" in function signature to bind "T" inside a function)
aliases_typealiastype.py:17: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]
aliases_typealiastype.py:18: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
aliases_typealiastype.py:18: note: (Hint: Use "T" in function signature to bind "T" inside a function)
aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:18: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:18: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:18: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]
aliases_typealiastype.py:19: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:22: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:22: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:22: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]
aliases_typealiastype.py:22: error: TypeVarTuple "Ts" is unbound [valid-type]
aliases_typealiastype.py:23: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object, object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined]
aliases_typealiastype.py:35: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]
aliases_typealiastype.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:36: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]
aliases_typealiastype.py:36: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:37: error: Unexpected "..." [misc]
aliases_typealiastype.py:37: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:37: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:38: error: Unexpected "..." [misc]
aliases_typealiastype.py:38: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:38: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:39: error: Bracketed expression "[...]" is not valid as a type [valid-type]
aliases_typealiastype.py:39: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:39: error: Unpack is only valid in a variadic position [valid-type]
aliases_typealiastype.py:40: error: Unexpected "..." [misc]
aliases_typealiastype.py:40: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:40: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:44: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:44: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:44: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:44: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:46: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:46: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:46: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:48: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:50: error: Cannot determine type of "BadAlias4" [has-type]
aliases_typealiastype.py:52: error: Cannot determine type of "BadAlias5" [has-type]
aliases_typealiastype.py:52: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:54: error: Cannot determine type of "BadAlias7" [has-type]
aliases_typealiastype.py:54: error: Name "BadAlias7" is used before definition [used-before-def]
aliases_typealiastype.py:69: error: Function "list" could always be true in boolean context [truthy-function]
"""
2 changes: 1 addition & 1 deletion conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "mypy 1.8.0"
test_duration = 0.3757450580596924
test_duration = 0.3814089298248291
Loading

0 comments on commit ca01411

Please sign in to comment.