https://github.com/python/cpython/commit/d76d95eacb8ac17e09a3f620db6e844d5ec17ec0
commit: d76d95eacb8ac17e09a3f620db6e844d5ec17ec0
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2024-05-18T21:06:41Z
summary:

[3.12] gh-119050: Add type hints to libregrtest/results.py (GH-119144) (#119157)

gh-119050: Add type hints to libregrtest/results.py (GH-119144)

Sort also 'omitted' in TestResults.display_result().
(cherry picked from commit 30b4e9f9c42493136c58c56fee5553128bb32428)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/test/libregrtest/results.py

diff --git a/Lib/test/libregrtest/results.py b/Lib/test/libregrtest/results.py
index a1abe89f4cd176..4bb087e1fed776 100644
--- a/Lib/test/libregrtest/results.py
+++ b/Lib/test/libregrtest/results.py
@@ -17,7 +17,7 @@
 
 
 class TestResults:
-    def __init__(self):
+    def __init__(self) -> None:
         self.bad: TestList = []
         self.good: TestList = []
         self.rerun_bad: TestList = []
@@ -35,22 +35,22 @@ def __init__(self):
         # used by --junit-xml
         self.testsuite_xml: list = []
 
-    def is_all_good(self):
+    def is_all_good(self) -> bool:
         return (not self.bad
                 and not self.skipped
                 and not self.interrupted
                 and not self.worker_bug)
 
-    def get_executed(self):
+    def get_executed(self) -> set[TestName]:
         return (set(self.good) | set(self.bad) | set(self.skipped)
                 | set(self.resource_denied) | set(self.env_changed)
                 | set(self.run_no_tests))
 
-    def no_tests_run(self):
+    def no_tests_run(self) -> bool:
         return not any((self.good, self.bad, self.skipped, self.interrupted,
                         self.env_changed))
 
-    def get_state(self, fail_env_changed):
+    def get_state(self, fail_env_changed: bool) -> str:
         state = []
         if self.bad:
             state.append("FAILURE")
@@ -195,7 +195,7 @@ def display_result(self, tests: TestTuple, quiet: bool, 
print_slowest: bool):
         omitted = set(tests) - self.get_executed()
 
         # less important
-        all_tests.append((omitted, "test", "{} omitted:"))
+        all_tests.append((sorted(omitted), "test", "{} omitted:"))
         if not quiet:
             all_tests.append((self.skipped, "test", "{} skipped:"))
             all_tests.append((self.resource_denied, "test", "{} skipped 
(resource denied):"))

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to