mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-07 02:54:00 +08:00
Change a few tests to match new typeshed
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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], /)'
|
||||
|
||||
Reference in New Issue
Block a user