Skip to content

Commit 9785782

Browse files
committed
Test nested legacy namespaces for editable installs
1 parent 39245fc commit 9785782

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

setuptools/tests/test_editable_install.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ def test_nspkg_file_is_unique(self, tmp_path, monkeypatch):
261261
files = list(installation_dir.glob("*-nspkg.pth"))
262262
assert len(files) == len(examples)
263263

264-
def test_namespace_package_importable(self, venv, tmp_path, editable_opts):
264+
@pytest.mark.parametrize("ns", ("myns.n",))
265+
def test_namespace_package_importable(self, venv, tmp_path, ns, editable_opts):
265266
"""
266267
Installing two packages sharing the same namespace, one installed
267268
naturally using pip or `--single-version-externally-managed`
@@ -274,16 +275,16 @@ def test_namespace_package_importable(self, venv, tmp_path, editable_opts):
274275
requires = ["setuptools"]
275276
build-backend = "setuptools.build_meta"
276277
"""
277-
pkg_A = namespaces.build_namespace_package(tmp_path, 'myns.pkgA')
278-
pkg_B = namespaces.build_namespace_package(tmp_path, 'myns.pkgB')
278+
pkg_A = namespaces.build_namespace_package(tmp_path, f"{ns}.pkgA")
279+
pkg_B = namespaces.build_namespace_package(tmp_path, f"{ns}.pkgB")
279280
(pkg_A / "pyproject.toml").write_text(build_system, encoding="utf-8")
280281
(pkg_B / "pyproject.toml").write_text(build_system, encoding="utf-8")
281282
# use pip to install to the target directory
282283
opts = editable_opts[:]
283284
opts.append("--no-build-isolation") # force current version of setuptools
284285
venv.run(["python", "-m", "pip", "install", str(pkg_A), *opts])
285286
venv.run(["python", "-m", "pip", "install", "-e", str(pkg_B), *opts])
286-
venv.run(["python", "-c", "import myns.pkgA; import myns.pkgB"])
287+
venv.run(["python", "-c", f"import {ns}.pkgA; import {ns}.pkgB"])
287288
# additionally ensure that pkg_resources import works
288289
venv.run(["python", "-c", "import pkg_resources"])
289290

0 commit comments

Comments
 (0)