bpo-26952: [argparse] clearer error when formatting an empty mutually… (GH-30099) (GH-30114)

(cherry picked from commit 86de99588db3beff964137f4fe27dd1077a09b35)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index ec49b2a..c96a540 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -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):