mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Reproduce the previous test failure w/o stdlib
It turned out that the failure occurs when you define "fake module path" by importing some module from others. Indeed, this is what happens in os.py.
This commit is contained in:
1
test/completion/import_tree/mod2.py
Normal file
1
test/completion/import_tree/mod2.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import mod1 as fake
|
||||||
@@ -56,6 +56,27 @@ def scope_nested():
|
|||||||
#? set
|
#? set
|
||||||
import_tree.random.a
|
import_tree.random.a
|
||||||
|
|
||||||
|
def scope_from_import_variable():
|
||||||
|
#? int()
|
||||||
|
from import_tree.mod2.fake import a
|
||||||
|
#? set
|
||||||
|
from import_tree.mod2.fake import c
|
||||||
|
|
||||||
|
#? int()
|
||||||
|
a
|
||||||
|
#? set
|
||||||
|
c
|
||||||
|
|
||||||
|
def scope_from_import_variable_with_parenthesis():
|
||||||
|
from import_tree.mod2.fake import (
|
||||||
|
a, c
|
||||||
|
)
|
||||||
|
|
||||||
|
#? int()
|
||||||
|
a
|
||||||
|
#? set
|
||||||
|
c
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# std lib modules
|
# std lib modules
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -206,7 +227,7 @@ import datetime.
|
|||||||
#? []
|
#? []
|
||||||
import datetime.date
|
import datetime.date
|
||||||
|
|
||||||
#? 18 ['mod1', 'random', 'pkg', 'rename1', 'rename2', 'import']
|
#? 18 ['mod1', 'mod2', 'random', 'pkg', 'rename1', 'rename2', 'import']
|
||||||
from import_tree. import pkg
|
from import_tree. import pkg
|
||||||
|
|
||||||
#? 18 ['pkg']
|
#? 18 ['pkg']
|
||||||
|
|||||||
Reference in New Issue
Block a user