|
12 | 12 |
|
13 | 13 | from spack.concretize import find_spec, NoValidVersionError |
14 | 14 | from spack.error import SpecError |
| 15 | +from spack.package_prefs import PackagePrefs |
15 | 16 | from spack.spec import Spec, CompilerSpec, ConflictsInSpecError |
16 | 17 | from spack.version import ver |
17 | 18 | from spack.util.mock_package import MockPackageMultiRepo |
@@ -102,17 +103,16 @@ def current_host(request, monkeypatch): |
102 | 103 | monkeypatch.setattr(spack.platforms.test.Test, 'default', cpu) |
103 | 104 | yield target |
104 | 105 | else: |
| 106 | + # There's a cache that needs to be cleared for unit tests |
| 107 | + PackagePrefs._packages_config_cache = None |
105 | 108 | with spack.config.override('packages:all', {'target': [cpu]}): |
106 | 109 | yield target |
107 | 110 |
|
108 | 111 | # clear any test values fetched |
109 | 112 | spack.architecture.get_platform.cache.clear() |
110 | 113 |
|
111 | 114 |
|
112 | | -# This must use the mutable_config fixture because the test |
113 | | -# adjusting_default_target_based_on_compiler uses the current_host fixture, |
114 | | -# which changes the config. |
115 | | -@pytest.mark.usefixtures('mutable_config', 'mock_packages') |
| 115 | +@pytest.mark.usefixtures('config', 'mock_packages') |
116 | 116 | class TestConcretize(object): |
117 | 117 | def test_concretize(self, spec): |
118 | 118 | check_concretize(spec) |
|
0 commit comments