mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
bpo-26952: [argparse] clearer error when formatting an empty mutually… (GH-30099) (GH-30115)
(cherry picked from commit 86de99588d)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
17260e44b5
commit
f0b274d2e2
3 changed files with 11 additions and 0 deletions
|
|
@ -2582,6 +2582,13 @@ def test_help(self):
|
|||
'''
|
||||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue