forked from VimPlug/jedi
Use imp.get_suffixes to deal with __init__ files that are not .py files but .so etc. fixes #472
This commit is contained in:
@@ -4,6 +4,7 @@ Test compiled module
|
||||
import os
|
||||
|
||||
import jedi
|
||||
from ..helpers import cwd_at
|
||||
|
||||
|
||||
def test_completions():
|
||||
@@ -29,3 +30,18 @@ def test_call_signatures_stdlib():
|
||||
sigs = s.call_signatures()
|
||||
assert len(sigs) == 1
|
||||
assert len(sigs[0].params) == 1
|
||||
|
||||
|
||||
@cwd_at('test/test_evaluate')
|
||||
def test_init_extension_module():
|
||||
"""
|
||||
``__init__`` extension modules are also packages and Jedi should understand
|
||||
that.
|
||||
|
||||
Originally coming from #472.
|
||||
"""
|
||||
s = jedi.Script('import init_extension_module as i\ni.', path='not_existing.py')
|
||||
assert 'foo' in [c.name for c in s.completions()]
|
||||
|
||||
s = jedi.Script('from init_extension_module import foo\nfoo', path='not_existing.py')
|
||||
assert ['foo'] == [c.name for c in s.completions()]
|
||||
|
||||
Reference in New Issue
Block a user