summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_optparse.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-09 06:26:12 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-09 06:26:12 (GMT)
commitaa34b6c2e32d3ff93ffe48fe6a67e87a28a3eed2 (patch)
treeffbeec978a96995f030271aca0f9b25ef6ba34ed /Lib/test/test_optparse.py
parent349c0ed27f5f23448173bc6a6f82680c8775d4ba (diff)
downloadcpython-aa34b6c2e32d3ff93ffe48fe6a67e87a28a3eed2.zip
cpython-aa34b6c2e32d3ff93ffe48fe6a67e87a28a3eed2.tar.gz
cpython-aa34b6c2e32d3ff93ffe48fe6a67e87a28a3eed2.tar.bz2
Get test_optparse to pass in -R mode by stop changing state (COLUMNS env var)
Diffstat (limited to 'Lib/test/test_optparse.py')
-rw-r--r--Lib/test/test_optparse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index cf83d75..f656b9f 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -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',