forked from VimPlug/jedi
Fix tests for namespace packages.
This commit is contained in:
@@ -771,7 +771,7 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)):
|
|||||||
def parent_callback():
|
def parent_callback():
|
||||||
return self._evaluator.execute(compiled.create(self._evaluator, str))[0]
|
return self._evaluator.execute(compiled.create(self._evaluator, str))[0]
|
||||||
|
|
||||||
names = ['__file__', '__package__', '__doc__', '__name__', '__version__']
|
names = ['__file__', '__package__', '__doc__', '__name__']
|
||||||
# All the additional module attributes are strings.
|
# All the additional module attributes are strings.
|
||||||
return [helpers.LazyName(n, parent_callback) for n in names]
|
return [helpers.LazyName(n, parent_callback) for n in names]
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ def test_namespace_package():
|
|||||||
# completion
|
# completion
|
||||||
completions = jedi.Script('from pkg import ').completions()
|
completions = jedi.Script('from pkg import ').completions()
|
||||||
names = [str(c.name) for c in completions] # str because of unicode
|
names = [str(c.name) for c in completions] # str because of unicode
|
||||||
compare = ['foo', 'ns1_file', 'ns1_folder', 'ns2_folder', 'ns2_file']
|
compare = ['foo', 'ns1_file', 'ns1_folder', 'ns2_folder', 'ns2_file',
|
||||||
|
'pkg_resources', 'pkgutil', '__name__', '__path__',
|
||||||
|
'__package__', '__file__', '__doc__']
|
||||||
# must at least contain these items, other items are not important
|
# must at least contain these items, other items are not important
|
||||||
assert set(compare) == set(names)
|
assert set(compare) == set(names)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user