@@ -261,7 +261,8 @@ def test_nspkg_file_is_unique(self, tmp_path, monkeypatch):
261
261
files = list (installation_dir .glob ("*-nspkg.pth" ))
262
262
assert len (files ) == len (examples )
263
263
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 ):
265
266
"""
266
267
Installing two packages sharing the same namespace, one installed
267
268
naturally using pip or `--single-version-externally-managed`
@@ -274,16 +275,16 @@ def test_namespace_package_importable(self, venv, tmp_path, editable_opts):
274
275
requires = ["setuptools"]
275
276
build-backend = "setuptools.build_meta"
276
277
"""
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" )
279
280
(pkg_A / "pyproject.toml" ).write_text (build_system , encoding = "utf-8" )
280
281
(pkg_B / "pyproject.toml" ).write_text (build_system , encoding = "utf-8" )
281
282
# use pip to install to the target directory
282
283
opts = editable_opts [:]
283
284
opts .append ("--no-build-isolation" ) # force current version of setuptools
284
285
venv .run (["python" , "-m" , "pip" , "install" , str (pkg_A ), * opts ])
285
286
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" ])
287
288
# additionally ensure that pkg_resources import works
288
289
venv .run (["python" , "-c" , "import pkg_resources" ])
289
290
0 commit comments