# we must restore its original value -- otherwise, this test
# screws things up for other tests when it's part of the Python
# test suite.
- with test_support.EnvironmentVarGuard() as env:
+ with support.EnvironmentVarGuard() as env:
env.set('COLUMNS', str(columns))
return InterceptingOptionParser(option_list=options)
self.assertHelpEquals(_expected_help_long_opts_first)
def test_help_title_formatter(self):
- with test_support.EnvironmentVarGuard() as env:
+ with support.EnvironmentVarGuard() as env:
env.set("COLUMNS", "80")
self.parser.formatter = TitledHelpFormatter()
self.assertHelpEquals(_expected_help_title_formatter)
self.assert_(isinstance(posixpath.expanduser(b"~root/"), bytes))
self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes))
- with test_support.EnvironmentVarGuard() as env:
+ with support.EnvironmentVarGuard() as env:
env.set('HOME', '/')
self.assertEqual(posixpath.expanduser("~"), "/")
# _candidate_tempdir_list contains the expected directories
# Make sure the interesting environment variables are all set.
- with test_support.EnvironmentVarGuard() as env:
+ with support.EnvironmentVarGuard() as env:
for envname in 'TMPDIR', 'TEMP', 'TMP':
dirname = os.getenv(envname)
if not dirname: