diff --git a/tests.py b/tests.py
index fa666550d02a39b30df0c1d461022733b782832e..b6bd9d3aa26f72b6ba3a4d668e8ad3b6256e4189 100644
--- a/tests.py
+++ b/tests.py
@@ -60,6 +60,12 @@ def test_prepare_environment(tmp_path):
     assert "global" in result
     assert "foss2021a-mpi" in result
 
+    # Expect an Exception when wrong mpsd_release is provided
+    with pytest.raises(Exception): 
+        result = mod.prepare_environment(
+            mpsd_release="wrong-mpsd-release", script_dir=(script_dir)
+        )
+
 
 def test_setup_log_cmd(tmp_path):
     # check that logs/install-software-environment.log is updated when the module is run
@@ -90,7 +96,7 @@ def test_install_environment(tmp_path):
             toolchains=["wrong-toolchain"],
             script_dir=(tmp_path),
         )
-    # Expect an Exception when wrong mpsd_release is provided
+    # Expect an Exception when wrong mpsd_release is provided ( part of prepare_environment)
     with pytest.raises(Exception):
         mod.install_environment(
             mpsd_release="wrong-mpsd-release",