diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 2b8cc1fca1f..c02c3bc8185 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -1473,7 +1473,7 @@ def long_message(self): out.write(" {0}\n".format(self.log_name)) # Also output the test log path IF it exists - if self.context != "test": + if self.context != "test" and have_log: test_log = join_path(os.path.dirname(self.log_name), spack_install_test_log) if os.path.isfile(test_log): out.write("\nSee test log for details:\n")