mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-09 13:32:20 +08:00
Move namespace tests to examples
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
foo = 'ns1!'
|
||||
|
||||
# this is a namespace package
|
||||
try:
|
||||
import pkg_resources
|
||||
pkg_resources.declare_namespace(__name__)
|
||||
except ImportError:
|
||||
import pkgutil
|
||||
__path__ = pkgutil.extend_path(__path__, __name__)
|
||||
@@ -1 +0,0 @@
|
||||
foo = 'ns1_file!'
|
||||
@@ -1 +0,0 @@
|
||||
foo = 'ns1_folder!'
|
||||
@@ -1 +0,0 @@
|
||||
foo = 'ns2_file!'
|
||||
@@ -1 +0,0 @@
|
||||
foo = 'ns2_folder!'
|
||||
@@ -1 +0,0 @@
|
||||
foo = 'nested!'
|
||||
@@ -1,4 +0,0 @@
|
||||
try:
|
||||
__import__('pkg_resources').declare_namespace(__name__)
|
||||
except ImportError:
|
||||
pass
|
||||
@@ -1 +0,0 @@
|
||||
CONST = 1
|
||||
@@ -1,13 +1,13 @@
|
||||
from os.path import dirname, join
|
||||
from os.path import join
|
||||
|
||||
import pytest
|
||||
import py
|
||||
|
||||
from ..helpers import get_example_dir
|
||||
from ..helpers import get_example_dir, example_dir
|
||||
|
||||
|
||||
SYS_PATH = [join(dirname(__file__), d)
|
||||
for d in ['namespace_package/ns1', 'namespace_package/ns2']]
|
||||
SYS_PATH = [get_example_dir('namespace_package', 'ns1'),
|
||||
get_example_dir('namespace_package', 'ns2')]
|
||||
|
||||
|
||||
def script_with_path(Script, *args, **kwargs):
|
||||
@@ -68,7 +68,7 @@ def test_completions(Script, source, solution):
|
||||
def test_nested_namespace_package(Script):
|
||||
code = 'from nested_namespaces.namespace.pkg import CONST'
|
||||
|
||||
sys_path = [dirname(__file__)]
|
||||
sys_path = [example_dir]
|
||||
|
||||
script = Script(sys_path=sys_path, source=code)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user