diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index 08ff41368d9bb0..f4afec81cfa397 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -7107,9 +7107,13 @@ class TestColorized(TestCase): def setUp(self): super().setUp() # Ensure color even if ran with NO_COLOR=1 + self.original_can_colorize = _colorize.can_colorize _colorize.can_colorize = lambda *args, **kwargs: True self.theme = _colorize.get_theme(force_color=True).argparse + def tearDown(self): + _colorize.can_colorize = self.original_can_colorize + def test_argparse_color(self): # Arrange: create a parser with a bit of everything parser = argparse.ArgumentParser(