]> granicus.if.org Git - python/commitdiff
Get test_optparse to pass in -R mode by stop changing state (COLUMNS env var)
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 9 Apr 2006 06:26:12 +0000 (06:26 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 9 Apr 2006 06:26:12 +0000 (06:26 +0000)
Lib/test/test_optparse.py

index cf83d75000863a567985e6674d4acd7781f119e2..f656b9f3b933b9163cf3418feb008eaee7a6ca3b 100644 (file)
@@ -1382,8 +1382,15 @@ options:
 
 class TestHelp(BaseTest):
     def setUp(self):
+        self.orig_columns = os.environ.get('COLUMNS')
         self.parser = self.make_parser(80)
 
+    def tearDown(self):
+        if self.orig_columns is None:
+            del os.environ['COLUMNS']
+        else:
+            os.environ['COLUMNS'] = self.orig_columns
+
     def make_parser(self, columns):
         options = [
             make_option("-a", type="string", dest='a',