summaryrefslogtreecommitdiff
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index ec49b2acbb..c96a540a8b 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -2582,6 +2582,13 @@ class TestMutuallyExclusiveGroupErrors(TestCase):
'''
self.assertEqual(parser.format_help(), textwrap.dedent(expected))
+ def test_empty_group(self):
+ # See issue 26952
+ parser = argparse.ArgumentParser()
+ group = parser.add_mutually_exclusive_group()
+ with self.assertRaises(ValueError):
+ parser.parse_args(['-h'])
+
class MEMixin(object):
def test_failures_when_not_required(self):