From ebe326d0d9bd8d250ed542a2129ee86c9b2f72a2 Mon Sep 17 00:00:00 2001 From: norbiros Date: Sat, 16 May 2026 15:17:46 +0200 Subject: [PATCH] fix: properly execute tests with the same file name --- toolbox/utils/tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toolbox/utils/tests.py b/toolbox/utils/tests.py index 394c2c9..ef6f42c 100644 --- a/toolbox/utils/tests.py +++ b/toolbox/utils/tests.py @@ -69,7 +69,14 @@ def run_tests( collector = _ResultCollector() buf = io.StringIO() with contextlib.redirect_stdout(buf), contextlib.redirect_stderr(buf): - pytest.main([str(test_path), "--tb=short", "--no-header"], plugins=[collector]) + pytest_exit_code = pytest.main( + [str(test_path), "--tb=short", "--no-header", "--import-mode=importlib"], + plugins=[collector], + ) + + if pytest_exit_code != 0 and collector.failed == 0: + collector.failed += 1 + collector.failures.append(buf.getvalue().strip()) task_passed += collector.passed task_failed += collector.failed