Change a few tests to match new typeshed

This commit is contained in:
Dave Halter
2026-04-29 09:30:49 +02:00
parent 04e5f5b3b8
commit fe0369436e
11 changed files with 29 additions and 25 deletions
+3 -3
View File
@@ -192,7 +192,7 @@ def test_hashlib_params(Script):
script = Script('from hashlib import sha256')
c, = script.complete()
sig, = c.get_signatures()
assert [p.name for p in sig.params] == ['string']
assert [p.name for p in sig.params] == ['data', 'usedforsecurity', 'string']
def test_signature_params(Script):
@@ -465,7 +465,7 @@ def test_import(get_names):
nms = nms[2].goto()
assert nms
assert all(n.type == 'module' for n in nms)
assert 'posixpath' in {n.name for n in nms}
assert 'path' in {n.name for n in nms}
nms = get_names('import os.path', references=True)
n = nms[0].goto()[0]
@@ -616,7 +616,7 @@ def test_definition_goto_follow_imports(Script):
('n = next; n', 'Union[next(__i: Iterator[_T]) -> _T, '
'next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]]'),
('abs', 'abs(__x: SupportsAbs[_T]) -> _T'),
('abs', 'abs(x: SupportsAbs[_T], /) -> _T'),
('def foo(x, y): return x if xxxx else y\nfoo(str(), 1)\nfoo',
'foo(x: str, y: int) -> Union[int, str]'),
('def foo(x, y = None): return x if xxxx else y\nfoo(str(), 1)\nfoo',
+1 -1
View File
@@ -52,7 +52,7 @@ class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase):
self.check("""
import re
any_re = re.compile('.*')
any_re""", 'typing.Pattern')
any_re""", 're.Pattern')
def test_from_import(self):
self.check('from os import path', 'os.path')
+1 -1
View File
@@ -68,4 +68,4 @@ def test_param_kind_and_name(code, index, param_code, kind, Script):
def test_staticmethod(Script):
s, = Script('staticmethod(').get_signatures()
assert s.to_string() == 'staticmethod(f: Callable[..., Any])'
assert s.to_string() == 'staticmethod(f: Callable[_P, _R_co], /)'