Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
|
|
@ -49,34 +49,6 @@ class TestNamespaces:
|
|||
with paths_on_pythonpath(map(str, targets)):
|
||||
subprocess.check_call(try_import)
|
||||
|
||||
def test_pkg_resources_import(self, tmpdir):
|
||||
"""
|
||||
Ensure that a namespace package doesn't break on import
|
||||
of pkg_resources.
|
||||
"""
|
||||
pkg = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
|
||||
target = tmpdir / 'packages'
|
||||
target.mkdir()
|
||||
install_cmd = [
|
||||
sys.executable,
|
||||
'-m',
|
||||
'pip',
|
||||
'install',
|
||||
'-t',
|
||||
str(target),
|
||||
str(pkg),
|
||||
]
|
||||
with paths_on_pythonpath([str(target)]):
|
||||
subprocess.check_call(install_cmd)
|
||||
namespaces.make_site_dir(target)
|
||||
try_import = [
|
||||
sys.executable,
|
||||
'-c',
|
||||
'import pkg_resources',
|
||||
]
|
||||
with paths_on_pythonpath([str(target)]):
|
||||
subprocess.check_call(try_import)
|
||||
|
||||
def test_namespace_package_installed_and_cwd(self, tmpdir):
|
||||
"""
|
||||
Installing a namespace packages but also having it in the current
|
||||
|
|
@ -97,42 +69,11 @@ class TestNamespaces:
|
|||
subprocess.check_call(install_cmd)
|
||||
namespaces.make_site_dir(target)
|
||||
|
||||
# ensure that package imports and pkg_resources imports
|
||||
# ensure that package imports
|
||||
pkg_resources_imp = [
|
||||
sys.executable,
|
||||
'-c',
|
||||
'import pkg_resources; import myns.pkgA',
|
||||
'import myns.pkgA',
|
||||
]
|
||||
with paths_on_pythonpath([str(target)]):
|
||||
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_A))
|
||||
|
||||
def test_packages_in_the_same_namespace_installed_and_cwd(self, tmpdir):
|
||||
"""
|
||||
Installing one namespace package and also have another in the same
|
||||
namespace in the current working directory, both of them must be
|
||||
importable.
|
||||
"""
|
||||
pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
|
||||
pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
|
||||
target = tmpdir / 'packages'
|
||||
# use pip to install to the target directory
|
||||
install_cmd = [
|
||||
sys.executable,
|
||||
'-m',
|
||||
'pip.__main__',
|
||||
'install',
|
||||
str(pkg_A),
|
||||
'-t',
|
||||
str(target),
|
||||
]
|
||||
subprocess.check_call(install_cmd)
|
||||
namespaces.make_site_dir(target)
|
||||
|
||||
# ensure that all packages import and pkg_resources imports
|
||||
pkg_resources_imp = [
|
||||
sys.executable,
|
||||
'-c',
|
||||
'import pkg_resources; import myns.pkgA; import myns.pkgB',
|
||||
]
|
||||
with paths_on_pythonpath([str(target)]):
|
||||
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_B))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue