I am not sure whether this is due to pyright’s breaking change or not.
====================================================== 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 ==================================================
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.
asynq/requirements.txt
Line 7 in 2983cde
I am not sure whether this is due to pyright’s breaking change or not.