summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_optparse.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-08-14 13:14:37 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-08-14 13:14:37 (GMT)
commit7cd8b42f32f18a08cedee7a1e424c4be6923e5c2 (patch)
tree8ec33169d647d42bad3b87c1d6d8dafb4f9565c5 /Lib/test/test_optparse.py
parent6bcd00afa9dde18c1bbeb0a4d2fb376bac9dfd2c (diff)
downloadcpython-7cd8b42f32f18a08cedee7a1e424c4be6923e5c2.zip
cpython-7cd8b42f32f18a08cedee7a1e424c4be6923e5c2.tar.gz
cpython-7cd8b42f32f18a08cedee7a1e424c4be6923e5c2.tar.bz2
#9161: Fix test to use standard optparse test pattern (what was I thinking?)
Diffstat (limited to 'Lib/test/test_optparse.py')
-rw-r--r--Lib/test/test_optparse.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index 59f752e..d4e5bb9 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -769,12 +769,12 @@ 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.")
+ def test_add_option_accepts_unicode(self):
+ self.parser.add_option(u"-u", u"--unicode", action="store_true")
+ self.assertParseOK(["-u"],
+ {'a': None, 'boo': None, 'foo': None, 'unicode': True},
+ [])
+
class TestBool(BaseTest):
def setUp(self):