summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorSteven Bethard <steven.bethard@gmail.com>2010-11-01 14:09:21 (GMT)
committerSteven Bethard <steven.bethard@gmail.com>2010-11-01 14:09:21 (GMT)
commitabacccc50c891f32c83dcf9ae38fe310ecf87409 (patch)
tree6e7f79019fa8e9c8b354ca954ba48da310631fe6 /Lib/test/test_argparse.py
parent87d86e09b5ef3fc7e007c8a6f5f0bc54e003b089 (diff)
downloadcpython-abacccc50c891f32c83dcf9ae38fe310ecf87409.zip
cpython-abacccc50c891f32c83dcf9ae38fe310ecf87409.tar.gz
cpython-abacccc50c891f32c83dcf9ae38fe310ecf87409.tar.bz2
Merged revisions 86080 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86080 | steven.bethard | 2010-11-01 14:56:09 +0100 (Mon, 01 Nov 2010) | 1 line Unset COLUMNS for test_argparse (and restore afterwards) (issue 9553) ........
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index a96bb5c..894ad58 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -27,6 +27,13 @@ class TestCase(unittest.TestCase):
print(obj2)
super(TestCase, self).assertEqual(obj1, obj2)
+ def setUp(self):
+ # The tests assume that line wrapping occurs at 80 columns, but this
+ # behaviour can be overridden by setting the COLUMNS environment
+ # variable. To ensure that this assumption is true, unset COLUMNS.
+ env = test_support.EnvironmentVarGuard()
+ env.unset("COLUMNS")
+ self.addCleanup(env.__exit__)
class TempDirMixin(object):
@@ -1726,6 +1733,7 @@ class TestAddSubparsers(TestCase):
return parser
def setUp(self):
+ super(TestAddSubparsers, self).setUp()
self.parser = self._get_parser()
self.command_help_parser = self._get_parser(subparser_help=True)
@@ -1953,6 +1961,7 @@ class TestParentParsers(TestCase):
self.assertRaises(ArgumentParserError, *args, **kwargs)
def setUp(self):
+ super(TestParentParsers, self).setUp()
self.wxyz_parent = ErrorRaisingArgumentParser(add_help=False)
self.wxyz_parent.add_argument('--w')
x_group = self.wxyz_parent.add_argument_group('x')