mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Get some sys completions working
This commit is contained in:
@@ -123,9 +123,7 @@ class TypeshedPlugin(BasePlugin):
|
|||||||
context_set = callback(
|
context_set = callback(
|
||||||
evaluator,
|
evaluator,
|
||||||
import_names,
|
import_names,
|
||||||
parent_module_context.actual_context # noqa
|
parent_module_context,
|
||||||
if isinstance(parent_module_context, StubModuleContext)
|
|
||||||
else parent_module_context,
|
|
||||||
sys_path
|
sys_path
|
||||||
)
|
)
|
||||||
# Don't use CompiledObjects, they are just annoying and don't
|
# Don't use CompiledObjects, they are just annoying and don't
|
||||||
|
|||||||
@@ -81,6 +81,12 @@ def test_method(Script):
|
|||||||
assert context.class_context.py__name__() == 'str'
|
assert context.class_context.py__name__() == 'str'
|
||||||
|
|
||||||
|
|
||||||
|
def test_sys(Script):
|
||||||
|
code = 'import sys; sys.exc_info()[1]'
|
||||||
|
def_, = Script(code).goto_definitions()
|
||||||
|
assert def_.name == 'BaseException'
|
||||||
|
|
||||||
|
|
||||||
def test_math(Script):
|
def test_math(Script):
|
||||||
def_, = Script('import math; math.acos()').goto_definitions()
|
def_, = Script('import math; math.acos()').goto_definitions()
|
||||||
assert def_.name == 'float'
|
assert def_.name == 'float'
|
||||||
|
|||||||
Reference in New Issue
Block a user