[Python-checkins] cpython (2.7): #9161: add test for the bug fixed by r82581.
r.david.murray
python-checkins at python.org
Tue Aug 14 04:04:51 CEST 2012
http://hg.python.org/cpython/rev/4c86a860e3d2
changeset: 78555:4c86a860e3d2
branch: 2.7
user: R David Murray <rdmurray at bitdance.com>
date: Mon Aug 13 22:04:30 2012 -0400
summary:
#9161: add test for the bug fixed by r82581.
Patch by Michael Johnson.
files:
Lib/test/test_optparse.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -769,6 +769,13 @@
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",
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list