Skip to content

Commit 904c5be

Browse files
committed
add test for changes
1 parent bd9e95a commit 904c5be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_argparse.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,6 +2934,19 @@ def test_alias_help(self):
29342934
3 3 help
29352935
"""))
29362936

2937+
def test_help_sets_default_description(self):
2938+
parser = argparse.ArgumentParser()
2939+
subparsers = parser.add_subparsers(dest="command")
2940+
2941+
sp1 = subparsers.add_parser("a", help="help a")
2942+
self.assertEqual(sp1.description, "help a")
2943+
2944+
sp2 = subparsers.add_parser("b", help="help b", description="explicit desc")
2945+
self.assertEqual(sp2.description, "explicit desc")
2946+
2947+
sp3 = subparsers.add_parser("c")
2948+
self.assertIsNone(sp3.description)
2949+
29372950
# ============
29382951
# Groups tests
29392952
# ============

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy