fix: set the raw error flag in one place

The test called main and left --offline and the WSL probe behind for the tests after it. say_raw_errors holds the rule, and the test calls it alone.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 09:10:34 +01:00
1 parent 482260f599
commit 498fa5cb11
5 files changed
+23 -25

No files matched your search

+3 -9
View File
@@ -7839,16 +7839,10 @@ class EachRunSaysErrorsFromItsOwnOptions(unittest.TestCase):
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
install.say_raw_errors(True)
self.assertTrue(install._RAW_ERRORS.is_set())
install.say_raw_errors(False)
self.assertFalse(install._RAW_ERRORS.is_set())