From: R David Murray Date: Tue, 14 Aug 2012 02:04:30 +0000 (-0400) Subject: #9161: add test for the bug fixed by r82581. X-Git-Tag: v2.7.5~109^2~386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe9efc57327b6306c5b755fae8ad6729484adcd4;p=python #9161: add test for the bug fixed by r82581. Patch by Michael Johnson. --- diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index f86ea0176a..59f752e937 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -769,6 +769,13 @@ class TestStandard(BaseTest): self.assertParseFail(["-test"], "no such option: -e") + def test_flag_accepts_unicode(self): + try: + self.parser.add_option(u"-u", u"--unicode") + self.parser.parse_args() + except TypeError: + self.fail("Failed parsing flag passed to add_option() as unicode.") + class TestBool(BaseTest): def setUp(self): options = [make_option("-v",