diff --git a/lib/spack/spack/test/config.py b/lib/spack/spack/test/config.py index 5f544a3129..2453172bec 100644 --- a/lib/spack/spack/test/config.py +++ b/lib/spack/spack/test/config.py @@ -1239,11 +1239,11 @@ def test_user_config_path_is_default_when_env_var_is_empty(working_env): assert os.path.expanduser("~%s.spack" % os.sep) == spack.paths._get_user_config_path() -def test_default_install_tree(monkeypatch): +def test_default_install_tree(monkeypatch, default_config): s = spack.spec.Spec("nonexistent@x.y.z %none@a.b.c arch=foo-bar-baz") monkeypatch.setattr(s, "dag_hash", lambda: "abc123") - projection = spack.config.get("config:install_tree:projections:all", scope="defaults") - assert s.format(projection) == "foo-bar-baz/none-a.b.c/nonexistent-x.y.z-abc123" + _, _, projections = spack.store.parse_install_tree(spack.config.get("config")) + assert s.format(projections["all"]) == "foo-bar-baz/none-a.b.c/nonexistent-x.y.z-abc123" def test_local_config_can_be_disabled(working_env): diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 514b1e9154..bfd32a8f3b 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -629,7 +629,7 @@ def platform_config(): spack.config.add_default_platform_scope(spack.platforms.real_host().name) -@pytest.fixture(scope="session") +@pytest.fixture def default_config(): """Isolates the default configuration from the user configs.