fix: clear the raw error flag on each run

--verbose set it and no run cleared it, so a later run in the same process ended its clock message with the raw SSL text. Also: --target named again in its refusal, three names mypy read as another type, a semicolon and a tooling file named in test comments.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 08:43:20 +01:00
1 parent 8e15f94ed1
commit e8e2215a49
8 files changed
+45 -35

No files matched your search

+18
View File
@@ -7834,5 +7834,23 @@ class TheNextStepFitsWhereTheInstallerRuns(unittest.TestCase):
install.NEXT_ON_CARD)
class EachRunSaysErrorsFromItsOwnOptions(unittest.TestCase):
"""--verbose set the raw-cause flag and nothing cleared it: a later run
in the same process ended its clock message with the raw SSL text."""
def test_a_run_without_verbose_clears_it(self):
install._RAW_ERRORS.set()
self.addCleanup(install._RAW_ERRORS.clear)
with unittest.mock.patch.object(sys, "argv",
["install.py", "--list-platforms", "--offline"]), \
contextlib.redirect_stdout(io.StringIO()), \
contextlib.redirect_stderr(io.StringIO()):
try:
install.main()
except SystemExit:
pass
self.assertFalse(install._RAW_ERRORS.is_set())
if __name__ == "__main__":
unittest.main()