Skip to content

Commit 4a78aef

Browse files
committed
fix: Check for empty summary file in regression to avoid errors outside of CI
1 parent f6f62e4 commit 4a78aef

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

regression.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@ def run_reg_test(name, **kwargs):
145145
reg_res[n] = t
146146

147147
summary_file = os.environ.get("GITHUB_STEP_SUMMARY")
148-
with open(summary_file, "w") as f:
149-
s = ""
150-
s += "# Regression Test Result\n"
151-
for k, v in reg_res.items():
152-
s += f"{k}: {v}\n"
153-
f.write(s)
148+
if summary_file is not None:
149+
with open(summary_file, "w") as f:
150+
s = ""
151+
s += "# Regression Test Result\n"
152+
for k, v in reg_res.items():
153+
s += f"{k}: {v}\n"
154+
f.write(s)
154155

155156

156157
if __name__ == "__main__":

0 commit comments

Comments
 (0)