summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsteven.bethard <devnull@localhost>2009-06-14 21:32:28 +0000
committersteven.bethard <devnull@localhost>2009-06-14 21:32:28 +0000
commitd77688d99d8ce50420fe5ac5e0a2df012ef25a55 (patch)
treec1972016959c3e7b6f0ed64be0319d0d81107141 /test
parentda2a4da94bdb285c7b568e4fd0e546577e446f33 (diff)
downloadargparse-d77688d99d8ce50420fe5ac5e0a2df012ef25a55.tar.gz
Allow None as the first argument to ArgumentError.
Diffstat (limited to 'test')
-rw-r--r--test/test_argparse.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_argparse.py b/test/test_argparse.py
index 6609e3c..a04f840 100644
--- a/test/test_argparse.py
+++ b/test/test_argparse.py
@@ -3495,5 +3495,16 @@ class TestEncoding(TestCase):
def test_test_argparse_module_encoding(self):
text = codecs.open(__file__, 'r', 'utf8').read()
+# ===================
+# ArgumentError tests
+# ===================
+
+class TestArgumentError(TestCase):
+
+ def test_argument_error(self):
+ msg = "my error here"
+ error = argparse.ArgumentError(None, msg)
+ self.failUnlessEqual(str(error), msg)
+
if __name__ == '__main__':
unittest.main()