Skip to content

Commit e27c90b

Browse files
committed
Add tearDown for _colorize.can_colorize modification in test_argparse
1 parent 24069fb commit e27c90b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_argparse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7107,9 +7107,13 @@ class TestColorized(TestCase):
71077107
def setUp(self):
71087108
super().setUp()
71097109
# Ensure color even if ran with NO_COLOR=1
7110+
self.original_can_colorize = _colorize.can_colorize
71107111
_colorize.can_colorize = lambda *args, **kwargs: True
71117112
self.theme = _colorize.get_theme(force_color=True).argparse
71127113

7114+
def tearDown(self):
7115+
_colorize.can_colorize = self.original_can_colorize
7116+
71137117
def test_argparse_color(self):
71147118
# Arrange: create a parser with a bit of everything
71157119
parser = argparse.ArgumentParser(

0 commit comments

Comments
 (0)