summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-02-18 22:22:49 +0100
committerGitHub <noreply@github.com>2021-02-18 13:22:49 -0800
commitf2e3edf6db08fc2bc43ee73c10d2da0fd06febd4 (patch)
tree5085434dc070718c4e3d4cd6322a3fab01d83b25 /var
parentcbcf8d208b12d9968afbbca0113d78e9851ad1ab (diff)
downloadspack-f2e3edf6db08fc2bc43ee73c10d2da0fd06febd4.tar.gz
spack-f2e3edf6db08fc2bc43ee73c10d2da0fd06febd4.tar.bz2
spack-f2e3edf6db08fc2bc43ee73c10d2da0fd06febd4.tar.xz
spack-f2e3edf6db08fc2bc43ee73c10d2da0fd06febd4.zip
Testing: use spack.store.use_store everywhere (#21656)
Keep spack.store.store and spack.store.db consistent in unit tests * Remove calls to monkeypatch for spack.store.store and spack.store.db: tests that used these called one or the other, which lead to inconsistencies (the tests passed regardless but were fragile as a result) * Fixtures making use of monkeypatch with mock_store now use the updated use_store function, which sets store.store and store.db consistently * subprocess_context.TestState now transfers the serializes and restores spack.store.store (without the monkeypatch changes this would have created inconsistencies)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/old-sbang/package.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/var/spack/repos/builtin.mock/packages/old-sbang/package.py b/var/spack/repos/builtin.mock/packages/old-sbang/package.py
index 3308f91611..305f693c5a 100644
--- a/var/spack/repos/builtin.mock/packages/old-sbang/package.py
+++ b/var/spack/repos/builtin.mock/packages/old-sbang/package.py
@@ -2,10 +2,11 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-
from spack import *
+import spack.paths
+import spack.store
+
class OldSbang(Package):
"""Toy package for testing the old sbang replacement problem"""
@@ -22,12 +23,12 @@ class OldSbang(Package):
#!/usr/bin/env python
{1}
- '''.format(spack.paths.prefix, prefix.bin)
+'''.format(spack.paths.prefix, prefix.bin)
sbang_style_2 = '''#!/bin/sh {0}/bin/sbang
#!/usr/bin/env python
{1}
- '''.format(spack.store.unpadded_root, prefix.bin)
+'''.format(spack.store.unpadded_root, prefix.bin)
with open('%s/sbang-style-1.sh' % self.prefix.bin, 'w') as f:
f.write(sbang_style_1)