]> www.git.momoyon.org Git - lang.git/commitdiff
[test.py] Update
authormomoyon <ahmedsamyh10@gmail.com>
Sun, 13 Apr 2025 12:40:17 +0000 (17:40 +0500)
committermomoyon <ahmedsamyh10@gmail.com>
Sun, 13 Apr 2025 12:40:17 +0000 (17:40 +0500)
test.py

diff --git a/test.py b/test.py
index b17fec0cd201315f73f1b68b19062de4bb738601..9e01350296593f714639db24d05c8c13b940e8e4 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -140,7 +140,7 @@ class Test:
                 with open(f, "w") as file:
                     pass
                     # NOTE: Why do we need to log this?
-                    # logger.info("Created empty {self.name}.{name}.expected")
+                    # logger.info(f"Created empty {self.name}.{name}.expected")
                 return ""
             else:
                 with open(f, "r") as file:
@@ -384,7 +384,7 @@ def main():
                     # vlog(verbose_output, f"[CMD] {cmd}")
                     res = subprocess.run(cmd, capture_output = True, text = True)
                 except Exception as e:
-                    logger.error("Failed to run ./{test_name}: {e}")
+                    logger.error(f"Failed to run ./{test_name}: {e}")
                     if stop_on_error: exit(1)
                     else: continue
 
@@ -400,12 +400,12 @@ def main():
                 passing_tests_count += 1
                 cprint('green', 'default', '[PASS]')
 
-            cprint("green", "default", f"PASSED {passing_tests_count}/{total_tests_count}")
+            cprint(f"green", "default", f"PASSED {passing_tests_count}/{total_tests_count}")
         elif subcmd == "record":
             check_crucial_envvar(RUN_CMD, "RUN_CMD")
             print(f'----- [RECORD] -----')
             for test_name in tests:
-                cprint("green", "default", f"+ Recording expected behaviour for '{test_name}'...")
+                cprint(f"green", "default", f"+ Recording expected behaviour for '{test_name}'...")
                 test = tests[test_name]
 
                 cmd = shlex.split(get_cmd_substituted(RUN_CMD, tests, test_name))
@@ -433,11 +433,11 @@ def main():
             check_crucial_envvar(BUILD_CMD, "BUILD_CMD")
             cprint("green", "default", f'----- [RECORD_BUILD] -----')
             for test_name in tests:
-                cprint("green", "default", f"+ Recording expected build behaviour for '{test_name}'...")
+                cprint(f"green", "default", f"+ Recording expected build behaviour for '{test_name}'...")
                 test = tests[test_name]
 
                 if len(test.build_stdin) > 0:
-                    logger.info("Test already has build_input '{test.build_stdin}'...")
+                    logger.info(f"Test already has build_input '{test.build_stdin}'...")
                     ans = input("Do you want to change the build_input? [y/N]")
                     if ans.lower() == 'y':
                         test.build_stdin = input("What is the input passed? ")
@@ -470,7 +470,7 @@ def main():
                     cprint('yellow', 'default', '[SKIP]')
 
         else:
-            logger.error("Invalid subcommand '{subcmd}'")
+            logger.error(f"Invalid subcommand '{subcmd}'")
             exit(1)
 
 if __name__ == "__main__":