summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/test/install.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py
index 296322b7ed..e8467490fb 100644
--- a/lib/spack/spack/test/install.py
+++ b/lib/spack/spack/test/install.py
@@ -383,3 +383,20 @@ def test_pkg_install_log(install_mockery):
# Cleanup
shutil.rmtree(log_dir)
+
+
+def test_unconcretized_install(install_mockery, mock_fetch, mock_packages):
+ """Test attempts to perform install phases with unconcretized spec."""
+ spec = Spec('trivial-install-test-package')
+
+ with pytest.raises(ValueError, match="only install concrete packages"):
+ spec.package.do_install()
+
+ with pytest.raises(ValueError, match="fetch concrete packages"):
+ spec.package.do_fetch()
+
+ with pytest.raises(ValueError, match="stage concrete packages"):
+ spec.package.do_stage()
+
+ with pytest.raises(ValueError, match="patch concrete packages"):
+ spec.package.do_patch()