From 741bbb57f67c8b9f384a74d7f38728de3ae25d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Thu, 29 Aug 2024 18:03:19 +1200 Subject: [PATCH] Fix 'roc format' in generate_tests.py --- bin/generate_tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/generate_tests.py b/bin/generate_tests.py index 987075e..d797b52 100755 --- a/bin/generate_tests.py +++ b/bin/generate_tests.py @@ -453,15 +453,14 @@ def generate_exercise( spec[plugins_name] = plugins_module logger.debug(f"{slug}: attempting render") rendered = template.render(**spec) - with NamedTemporaryFile("w", delete=False) as tmp: + with NamedTemporaryFile("w", suffix=".roc", delete=False) as tmp: logger.debug(f"{slug}: writing render to tmp file {tmp.name}") tmpfile = Path(tmp.name) tmp.write(rendered) try: logger.debug(f"{slug}: formatting tmp file {tmpfile}") format_file(tmpfile) - except FileNotFoundError as e: - logger.error(f"{slug}: the black utility must be installed") + except subprocess.CalledProcessError as e: return False if check: