Skip to content

Commit be1d524

Browse files
committed
Address CI failures
1 parent c76d422 commit be1d524

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

mypyc/test-data/run-singledispatch.test

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,6 @@ def verify_typeinfo(stub: TypeInfo, a: MaybeMissing[Type[Any]], b: List[str]) ->
347347
yield Error('in TypeInfo')
348348
yield Error('hello')
349349

350-
@verify.register(TypeVarExpr)
351-
def verify_typevarexpr(stub: TypeVarExpr, a: MaybeMissing[Any], b: List[str]) -> Iterator[Error]:
352-
if False:
353-
yield None
354-
355350
def verify_list(stub, a, b) -> List[str]:
356351
"""Helper function that converts iterator of errors to list of messages"""
357352
return list(err.msg for err in verify(stub, a, b))
@@ -361,7 +356,6 @@ def test_verify() -> None:
361356
assert verify_list(MypyFile(), MISSING, ['a', 'b']) == ["shouldn't be missing"]
362357
assert verify_list(MypyFile(), 5, ['a', 'b']) == ['in TypeInfo', 'hello']
363358
assert verify_list(TypeInfo(), str, ['a', 'b']) == ['in TypeInfo', 'hello']
364-
assert verify_list(TypeVarExpr(), 'a', ['x', 'y']) == []
365359

366360

367361
[case testArgsInRegisteredImplNamedDifferentlyFromMainFunction]

test-data/unit/daemon.test

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@ $ dmypy inspect foo.py:1:2:3:4
463463
Can't find expression at span 1:2:3:4
464464
== Return code: 1
465465
$ dmypy inspect foo.py:17:5:17:5
466-
No known type available for "NameExpr" (maybe unreachable or try --force-reload)
467-
== Return code: 1
466+
"int"
468467

469468
[file foo.py]
470469
from typing import Optional
@@ -523,9 +522,8 @@ $ dmypy inspect foo.py:1:2
523522
Can't find any expressions at position 1:2
524523
== Return code: 1
525524
$ dmypy inspect foo.py:11:5 --force-reload
526-
No known type available for "NameExpr" (maybe unreachable)
527-
No known type available for "OpExpr" (maybe unreachable)
528-
== Return code: 1
525+
"int"
526+
"int"
529527

530528
[file foo.py]
531529
from typing import Optional
@@ -547,8 +545,7 @@ $ dmypy check foo.py bar.py --export-types
547545
$ dmypy inspect foo.py:9:1 --show attrs --include-span --include-kind -vv
548546
NameExpr:9:1:9:1 -> {"foo.C": ["a", "x", "y"], "foo.B": ["a", "b"]}
549547
$ dmypy inspect foo.py:11:10 --show attrs
550-
No known type available for "StrExpr" (maybe unreachable or try --force-reload)
551-
== Return code: 1
548+
{"str": ["__add__", "__contains__", "__eq__", "__ge__", "__getitem__", "__getnewargs__", "__gt__", "__hash__", "__iter__", "__le__", "__len__", "__lt__", "__mod__", "__mul__", "__ne__", "__new__", "__rmul__", "capitalize", "casefold", "center", "count", "encode", "endswith", "expandtabs", "find", "format", "format_map", "index", "isalnum", "isalpha", "isascii", "isdecimal", "isdigit", "isidentifier", "islower", "isnumeric", "isprintable", "isspace", "istitle", "isupper", "join", "ljust", "lower", "lstrip", "maketrans", "partition", "removeprefix", "removesuffix", "replace", "rfind", "rindex", "rjust", "rpartition", "rsplit", "rstrip", "split", "splitlines", "startswith", "strip", "swapcase", "title", "translate", "upper", "zfill"], "Sequence": ["__contains__", "__getitem__", "__iter__", "__reversed__", "count", "index"], "Reversible": ["__reversed__"], "Collection": ["__len__"], "Iterable": ["__iter__"], "Container": ["__contains__"]}
552549
$ dmypy inspect foo.py:1:1 --show attrs
553550
Can't find any expressions at position 1:1
554551
== Return code: 1

test-data/unit/pythoneval.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,10 @@ if isinstance(x, int):
14811481
[out]
14821482
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:3: error: Subclass of "str" and "bytes" cannot exist: would have incompatible method signatures
14831483
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:4: error: Statement is unreachable
1484+
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:4: note: Revealed type is "Never"
14841485
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:6: error: Subclass of "str" and "int" cannot exist: would have incompatible method signatures
14851486
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:7: error: Statement is unreachable
1487+
_testIsInstanceAdHocIntersectionWithStrAndBytes.py:7: note: Revealed type is "Never"
14861488

14871489
[case testAsyncioFutureWait]
14881490
# mypy: strict-optional
@@ -1553,6 +1555,7 @@ if isinstance(obj, Awaitable):
15531555
[out]
15541556
_testSpecialTypingProtocols.py:6: note: Revealed type is "Tuple[builtins.int]"
15551557
_testSpecialTypingProtocols.py:8: error: Statement is unreachable
1558+
_testSpecialTypingProtocols.py:8: note: Revealed type is "Never"
15561559

15571560
[case testTypeshedRecursiveTypesExample]
15581561
from typing import List, Union

test-data/unit/reports.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def bar(x):
235235
<span class="line-any" title="Any Types on this line:
236236
Explicit (x1)"> any_f(x)</span>
237237
<span class="line-precise" title="No Anys on this line!"> assert False</span>
238-
<span class="line-unanalyzed" title="No Anys on this line!"> any_f(x)</span>
238+
<span class="line-any" title="Any Types on this line:
239+
Explicit (x1)"> any_f(x)</span>
239240
</pre></td>
240241
</tr></tbody>
241242
</table>
@@ -296,10 +297,10 @@ def bar(x):
296297
[outfile report/any-exprs.txt]
297298
Name Anys Exprs Coverage
298299
---------------------------------
299-
i 1 6 83.33%
300+
i 0 8 100.00%
300301
j 0 5 100.00%
301302
---------------------------------
302-
Total 1 11 90.91%
303+
Total 0 13 100.00%
303304

304305
[case testAnyExprReportHigherKindedTypesAreNotAny]
305306
# cmd: mypy --any-exprs-report report i.py

0 commit comments

Comments
 (0)