Make test_optparse pass.

This commit is contained in:
Guido van Rossum 2007-07-09 10:08:42 +00:00
parent a222e4cc71
commit b4e87e3792
1 changed files with 1 additions and 5 deletions

View File

@ -1463,10 +1463,6 @@ class TestHelp(BaseTest):
os.environ['COLUMNS'] = orig_columns os.environ['COLUMNS'] = orig_columns
def assertHelpEquals(self, expected_output): def assertHelpEquals(self, expected_output):
if isinstance(expected_output, unicode):
encoding = self.parser._get_encoding(sys.stdout)
expected_output = expected_output.encode(encoding, "replace")
save_argv = sys.argv[:] save_argv = sys.argv[:]
try: try:
# Make optparse believe bar.py is being executed. # Make optparse believe bar.py is being executed.
@ -1595,7 +1591,7 @@ class TestParseNumber(BaseTest):
self.assertRaises( self.assertRaises(
_parse_num, ("0xOoops", int), {}, _parse_num, ("0xOoops", int), {},
ValueError, ValueError,
re.compile(r"invalid literal for int().*: '?0xOoops'?")) re.compile(r"invalid literal for int().*: s?'?0xOoops'?"))
def test_parse_num_ok(self): def test_parse_num_ok(self):
self.assertEqual(_parse_num("0", int), 0) self.assertEqual(_parse_num("0", int), 0)