From 102e8b8414039ae63cc62bdd0a848cced2cef11d Mon Sep 17 00:00:00 2001 From: kei-nan Date: Thu, 28 May 2026 22:59:00 +0300 Subject: [PATCH 1/2] fix(failed_tests_file): correctly iterate testsFailed dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `self.testsFailed` is a dict of `{test_name: [failures]}` (built via `setdefault(name, []).extend(...)`). The `--failed-tests-file` writer was iterating it as `for test, _ in self.testsFailed:`, which yields dict keys (strings) and tries to unpack each key into two elements — crashing with `ValueError: too many values to unpack (expected 2)` on any test name longer than two characters. This silently broke the failed-tests-file feature whenever a real run had failures: the writer aborted before producing the file, so any downstream tooling that depends on it saw no output. Fix by iterating keys directly, since the value side wasn't used. --- RLTest/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RLTest/__main__.py b/RLTest/__main__.py index 0d5e175..ae60443 100644 --- a/RLTest/__main__.py +++ b/RLTest/__main__.py @@ -1067,7 +1067,7 @@ def _get_result(): if self.testsFailed: if self.args.failed_tests_file: with open(self.args.failed_tests_file, 'w') as file: - for test, _ in self.testsFailed: + for test in self.testsFailed: file.write(test.split(' ')[0] + "\n") print(Colors.Bold('Failed Tests Summary:')) From 5806e03e6584ea39f278c8195e978597bdbcbdc5 Mon Sep 17 00:00:00 2001 From: kei-nan Date: Thu, 28 May 2026 23:38:58 +0300 Subject: [PATCH 2/2] address review: use .keys() to make intent explicit Per @JoanFM, iterating the dict directly works but is implicit. Using .keys() makes it obvious to the reader that only the keys are needed. --- RLTest/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RLTest/__main__.py b/RLTest/__main__.py index ae60443..9bb7143 100644 --- a/RLTest/__main__.py +++ b/RLTest/__main__.py @@ -1067,7 +1067,7 @@ def _get_result(): if self.testsFailed: if self.args.failed_tests_file: with open(self.args.failed_tests_file, 'w') as file: - for test in self.testsFailed: + for test in self.testsFailed.keys(): file.write(test.split(' ')[0] + "\n") print(Colors.Bold('Failed Tests Summary:'))