PythonPackage: run test_imports in run env context
This commit is contained in:
parent
0a03a92e78
commit
d4a28b4e22
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
import spack.builder
|
import spack.builder
|
||||||
import spack.config
|
import spack.config
|
||||||
|
import spack.context
|
||||||
import spack.deptypes as dt
|
import spack.deptypes as dt
|
||||||
import spack.detection
|
import spack.detection
|
||||||
import spack.multimethod
|
import spack.multimethod
|
||||||
@ -237,7 +238,12 @@ def test_imports(self) -> None:
|
|||||||
purpose=f"checking import of {module}",
|
purpose=f"checking import of {module}",
|
||||||
work_dir="spack-test",
|
work_dir="spack-test",
|
||||||
):
|
):
|
||||||
python("-c", f"import {module}")
|
setup_context = spack.build_environment.SetupContext(
|
||||||
|
self.spec, context=spack.context.Context.RUN
|
||||||
|
)
|
||||||
|
mods = setup_context.get_env_modifications()
|
||||||
|
with mods.set_env():
|
||||||
|
python("-c", f"import {module}")
|
||||||
|
|
||||||
def update_external_dependencies(self, extendee_spec=None):
|
def update_external_dependencies(self, extendee_spec=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user