Skip to content

Commit 68aaa64

Browse files
committed
update comments, remove mutable_config fixture from individual test because it was applied from the containing class
1 parent defca4e commit 68aaa64

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

lib/spack/spack/test/concretization/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def test_disable_mixing_override_by_package(self):
484484
with pytest.raises(spack.error.UnsatisfiableSpecError):
485485
spack.concretize.concretize_one("dt-diamond%clang ^dt-diamond-left%gcc")
486486

487-
def test_disable_mixing_reuse(self, mutable_database, mutable_config):
487+
def test_disable_mixing_reuse(self, mutable_database):
488488
# Install a spec
489489
left = spack.concretize.concretize_one("dt-diamond-left %gcc")
490490
PackageInstaller([left.package], fake=True, explicit=True).install()

lib/spack/spack/test/conftest.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -501,22 +501,12 @@ def mock_stage(tmp_path_factory: pytest.TempPathFactory, monkeypatch, request):
501501

502502

503503
@pytest.fixture(scope="session")
504-
def mock_stage_for_database(tmp_path_factory: pytest.TempPathFactory, monkeypatch_session, request):
505-
"""Establish the temporary build_stage for the mock archive."""
506-
# The approach with this autouse fixture is to set the stage root
507-
# instead of using spack.config.override() to avoid configuration
508-
# conflicts with dozens of tests that rely on other configuration
509-
# fixtures, such as config.
510-
511-
if "nomockstage" in request.keywords:
512-
# Tests can opt-out with @pytest.mark.nomockstage
513-
yield None
514-
return
515-
516-
# Set the build stage to the requested path
504+
def mock_stage_for_database(tmp_path_factory: pytest.TempPathFactory, monkeypatch_session):
505+
"""A session-scoped analog of mock_stage, so that the mock_store
506+
fixture uses its own stage vs. the global stage root for spack.
507+
"""
517508
new_stage = tmp_path_factory.mktemp("mock-stage")
518509

519-
# Ensure the source directory exists within the new stage path
520510
source_path = new_stage / spack.stage._source_path_subdir
521511
source_path.mkdir(parents=True, exist_ok=True)
522512

0 commit comments

Comments
 (0)