Skip to content

test_mypy.yml fails hilariously on Python 3.10 #767

@hynek

Description

@hynek

The error list is long than my scrollback buffer, but here's an example:

/Users/hynek/FOSS/attrs/tests/test_mypy.yml:118:
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output:
E   Expected:
E     main:6: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:11: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:16: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:21: error: Incompatible return value type (got "int", expected "str") (diff)
E   Actual:
E     ../../../../../../Users/hynek/FOSS/attrs/.tox/py310/lib/python3.10/site-packages/mypy/typeshed/stdlib/3/types.pyi:334: error: Name '_NotImplementedType' is not defined (diff)
E     main:6: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:11: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:16: error: Incompatible return value type (got "int", expected "str") (diff)
E     main:21: error: Incompatible return value type (got "int", expected "str") (diff)
E
E   Alignment of first line difference:
E     E: main:6: error: Incompatible return value type (got "int", expected "str"...
E     A: ../../../../../../Users/hynek/FOSS/attrs/.tox/py310/lib/python3.10/site-...
E        ^

or

/Users/hynek/FOSS/attrs/tests/test_mypy.yml:277:
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output:
E   Expected:
E     main:5: note: Revealed type is 'def (a: builtins.int) -> main.A' (diff)
E     main:7: error: Unsupported left operand type for < ("A") (diff)
E     main:8: error: Unsupported left operand type for <= ("A") (diff)
E     main:9: error: Unsupported left operand type for > ("A") (diff)
E     ...
E   Actual:
E     ../../../../../../Users/hynek/FOSS/attrs/.tox/py310/lib/python3.10/site-packages/mypy/typeshed/stdlib/3/types.pyi:334: error: Name '_NotImplementedType' is not defined (diff)
E     main:5: note: Revealed type is 'def (a: builtins.int) -> main.A' (diff)
E     main:7: error: Unsupported left operand type for < ("A") (diff)
E     main:8: error: Unsupported left operand type for <= ("A") (diff)
E     main:9: error: Unsupported left operand type for > ("A") (diff)
E     ...
E
E   Alignment of first line difference:
E     E: main:5: note: Revealed type is 'def (a: builtins.int) -> main.A'...
E     A: ../../../../../../Users/hynek/FOSS/attrs/.tox/py310/lib/python3.10/site-...
E        ^

I'm not sure what to do about it at all but I guess we should fix it going forward.

Metadata

Metadata

Assignees

Labels

BugTypingTyping/stub/Mypy/PyRight related bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions