From 1fcf707096724aeada5d0f61598a720cf55caa25 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 14 May 2025 16:46:41 +0200 Subject: [PATCH] fix test --- lib/spack/spack/test/repo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/test/repo.py b/lib/spack/spack/test/repo.py index cb9f12fc79b..33f95f0c345 100644 --- a/lib/spack/spack/test/repo.py +++ b/lib/spack/spack/test/repo.py @@ -247,9 +247,10 @@ def test_real_name(self, module_name, pkg_name, mock_test_cache, tmp_path): used to import the Python module. """ path, _ = spack.repo.create_repo(str(tmp_path), package_api=(1, 0)) - pkg_path = pathlib.Path(path) / "packages" / pkg_name / "package.py" - pkg_path.parent.mkdir(parents=True) - pkg_path.write_text("") + if pkg_name is not None: + pkg_path = pathlib.Path(path) / "packages" / pkg_name / "package.py" + pkg_path.parent.mkdir(parents=True) + pkg_path.write_text("") repo = spack.repo.Repo( path, cache=spack.util.file_cache.FileCache(str(tmp_path / "cache")) )