diff options
| author | Abhinav Yadav <72503824+SirAbhi13@users.noreply.github.com> | 2022-06-20 21:04:52 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 17:34:52 +0200 |
| commit | 2887b9f67cadc5295ef6a0574de2c2c8fdd66905 (patch) | |
| tree | b7c0c92f2769960ac2632a476b7bc1ec873c2ca3 /tests/user_commands/tests.py | |
| parent | d7f5bfd241666c0a76e90208da1e9ef81aec44db (diff) | |
Fixed #33657 -- Allowed customizing formatter class of argument parsers.
Diffstat (limited to 'tests/user_commands/tests.py')
| -rw-r--r-- | tests/user_commands/tests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 222a1c5835..b840ef8087 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -1,4 +1,5 @@ import os +from argparse import ArgumentDefaultsHelpFormatter from io import StringIO from unittest import mock @@ -408,8 +409,14 @@ class CommandTests(SimpleTestCase): def test_create_parser_kwargs(self): """BaseCommand.create_parser() passes kwargs to CommandParser.""" epilog = "some epilog text" - parser = BaseCommand().create_parser("prog_name", "subcommand", epilog=epilog) + parser = BaseCommand().create_parser( + "prog_name", + "subcommand", + epilog=epilog, + formatter_class=ArgumentDefaultsHelpFormatter, + ) self.assertEqual(parser.epilog, epilog) + self.assertEqual(parser.formatter_class, ArgumentDefaultsHelpFormatter) def test_outputwrapper_flush(self): out = StringIO() |
