Fix a goto case with nested pyi files

This commit is contained in:
Dave Halter
2019-12-15 17:37:24 +01:00
parent 35442eff81
commit 6e2a76feb9
5 changed files with 56 additions and 36 deletions

View File

@@ -14,3 +14,10 @@ def test_sqlite3_conversion(Script):
d, = script1.goto_definitions(only_stubs=True)
assert d.is_stub()
assert d.full_name == 'sqlite3.dbapi2.Connection'
script2 = Script(path=d.module_path, line=d.line, column=d.column)
d, = script2.goto_definitions()
assert not d.is_stub()
assert d.full_name == 'sqlite3.Connection'
v, = d._name.infer()
assert v.is_compiled()

View File

@@ -28,12 +28,12 @@ from test.helpers import root_dir
{'goto_has_python': True}],
['from keyword import kwlist; kwlist', 'typing.Sequence', True, True,
{'full_name': 'keyword.kwlist'}],
{'goto_full_name': 'keyword.kwlist'}],
['from keyword import kwlist', 'typing.Sequence', True, True,
{'full_name': 'keyword.kwlist'}],
{'goto_full_name': 'keyword.kwlist'}],
['from socket import AF_INET', 'socket.AddressFamily', True, False,
{'full_name': 'socket.AF_INET'}],
{'goto_full_name': 'socket.AF_INET'}],
['from socket import socket', 'socket.socket', True, True, {}],
['import with_stub', 'with_stub', True, True, {}],