summaryrefslogtreecommitdiff
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2018-07-25 18:23:44 +0300
committerGitHub <noreply@github.com>2018-07-25 18:23:44 +0300
commit74102c9a5f2327c4fc47feefa072854a53551d1f (patch)
treebc6ef255acbe46650c753977363c7c7c5e9d5c73 /Lib/test/test_argparse.py
parentc0f0a7669c73c0d444851dd4c5299de2479214cc (diff)
downloadcpython-git-74102c9a5f2327c4fc47feefa072854a53551d1f.tar.gz
bpo-13041: Use shutil.get_terminal_size() in argparse.HelpFormatter (GH-8459)
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 85449c7299..f0802a5097 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -23,9 +23,9 @@ class TestCase(unittest.TestCase):
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.
+ # variable. To ensure that this width is used, set COLUMNS to 80.
env = support.EnvironmentVarGuard()
- env.unset("COLUMNS")
+ env['COLUMNS'] = '80'
self.addCleanup(env.__exit__)
@@ -5122,6 +5122,7 @@ class TestImportStar(TestCase):
class TestWrappingMetavar(TestCase):
def setUp(self):
+ super().setUp()
self.parser = ErrorRaisingArgumentParser(
'this_is_spammy_prog_with_a_long_name_sorry_about_the_name'
)