Skip to content

test failure with pyright>=1.1.399 #169

Description

@e-kwsm

As of 2983cde.

asynq/tests/test_pyright.py fails with pyright>=1.1.399, while it is successful with pyright==1.1.384 as used in tox.

pyright==1.1.384

I am not sure whether this is due to pyright’s breaking change or not.

# pip freeze; python==3.14.5
black==24.10.0
click==8.4.1
Cython==3.2.5
iniconfig==2.3.0
mypy==1.11.2
mypy_extensions==1.1.0
nodeenv==1.10.0
packaging==26.2
pathspec==1.1.1
platformdirs==4.10.0
pluggy==1.6.0
Pygments==2.20.0
pyright==1.1.399  # XXX
pytest==9.0.3
qcore==1.11.1
typing_extensions==4.12.2
====================================================== FAILURES =======================================================
__________________________________________________ test_return_type ___________________________________________________

    def test_return_type():
        assert _run_pyright("asynq/tests/typing_example/param_spec.py") == [
            dict(
                rule="reportArgumentType",
                message='Argument of type "Literal[\'1\']" cannot be assigned to parameter "arg1" of type "int" in function "asyncio"\n  "Literal[\'1\']" is not assignable to "int"',
                range={
                    "start": {"line": 14, "character": 25},
                    "end": {"line": 14, "character": 28},
                },
            ),
            dict(
                rule="reportArgumentType",
                message='Argument of type "Literal[2]" cannot be assigned to parameter "arg2" of type "str" in function "asyncio"\n  "Literal[2]" is not assignable to "str"',
                range={
                    "start": {"line": 14, "character": 35},
                    "end": {"line": 14, "character": 36},
                },
            ),
        ]
>       assert _run_pyright("asynq/tests/typing_example/return_type.py") == [
            dict(
                rule="reportAssignmentType",
                message='Type "int" is not assignable to declared type "str"\n  "int" is not assignable to "str"',
                range={
                    "start": {"line": 38, "character": 13},
                    "end": {"line": 38, "character": 31},
                },
            ),
            dict(
                rule="reportAssignmentType",
                message='Type "int" is not assignable to declared type "str"\n  "int" is not assignable to "str"',
                range={
                    "start": {"line": 41, "character": 13},
                    "end": {"line": 41, "character": 31},
                },
            ),
            dict(
                rule="reportAssignmentType",
                message='Type "int" is not assignable to declared type "str"\n  "int" is not assignable to "str"',
                range={
                    "start": {"line": 44, "character": 13},
                    "end": {"line": 44, "character": 31},
                },
            ),
            dict(
                rule="reportAssignmentType",
                message='Type "int" is not assignable to declared type "str"\n  "int" is not assignable to "str"',
                range={
                    "start": {"line": 47, "character": 13},
                    "end": {"line": 47, "character": 31},
                },
            ),
        ]
E       assert [] == [{'message': ...ignmentType'}]
E         
E         Right contains 4 more items, first extra item: {'message': 'Type "int" is not assignable to declared type "str"\n  "int" is not assignable to "str"', 'range': {'end
E         
E         ...Full output truncated (2 lines hidden), use '-vv' to show

asynq/tests/test_pyright.py:42: AssertionError
=============================================== short test summary info ===============================================
FAILED asynq/tests/test_pyright.py::test_return_type - assert [] == [{'message': ...ignmentType'}]
================================================== 1 failed in 0.97s ==================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions