From 006e905957ad7d5d76845876b4528acd40d59598 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 6 Jan 2023 12:57:34 +0100 Subject: [PATCH] Tests: support running benchmark when Blender prints unrelated text I noticed that sometimes the geometry nodes benchmark would not work if there were some left-over debug prints in the code. The reason it did not work was because the prints were mixed with the test output print. I also tried using explicit flusing and `atexit` for printing the test output, but that didn't solve it. Just printing additional newlines to better separate the test output from other printed output helped though. --- tests/performance/api/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/performance/api/environment.py b/tests/performance/api/environment.py index 1e2e4a84e81..094dbfa67ed 100644 --- a/tests/performance/api/environment.py +++ b/tests/performance/api/environment.py @@ -241,7 +241,7 @@ class TestEnvironment: f'args = pickle.loads(base64.b64decode({args}))\n' f'result = {modulename}.{functionname}(args)\n' f'result = base64.b64encode(pickle.dumps(result))\n' - f'print("{output_prefix}" + result.decode())\n') + f'print("\\n{output_prefix}" + result.decode() + "\\n")\n') expr_args = blender_args + ['--python-expr', expression] lines = self.call_blender(expr_args, foreground=foreground)