From fe9efc57327b6306c5b755fae8ad6729484adcd4 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Mon, 13 Aug 2012 22:04:30 -0400 Subject: [PATCH] #9161: add test for the bug fixed by r82581. Patch by Michael Johnson. --- Lib/test/test_optparse.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index f86ea0176ac..59f752e9371 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",