summaryrefslogtreecommitdiff
path: root/tests/test_argparse.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-01-31 22:29:57 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2021-01-31 22:29:57 -0500
commitf456b802754c3d1095b488d670bebba21018d823 (patch)
treebf7011f585a8a35ab4cc7ff98aaeebed4de87f84 /tests/test_argparse.py
parent918200c02d392c17862fff81bbf58820ed15c725 (diff)
downloadcmd2-git-f456b802754c3d1095b488d670bebba21018d823.tar.gz
Add black for automatic code format
Diffstat (limited to 'tests/test_argparse.py')
-rw-r--r--tests/test_argparse.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/test_argparse.py b/tests/test_argparse.py
index e7806056..b28f722b 100644
--- a/tests/test_argparse.py
+++ b/tests/test_argparse.py
@@ -4,17 +4,13 @@
Cmd2 testing for argument parsing
"""
import argparse
-from typing import (
- Optional,
-)
+from typing import Optional
import pytest
import cmd2
-from .conftest import (
- run_cmd,
-)
+from .conftest import run_cmd
# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
try:
@@ -312,8 +308,9 @@ class SubcommandApp(cmd2.Cmd):
helpless_subcmd_parser = cmd2.Cmd2ArgumentParser(add_help=False, description="A subcommand with no help")
- @cmd2.as_subcommand_to('test_subcmd_decorator', 'helpless_subcmd', helpless_subcmd_parser,
- help=helpless_subcmd_parser.description.lower())
+ @cmd2.as_subcommand_to(
+ 'test_subcmd_decorator', 'helpless_subcmd', helpless_subcmd_parser, help=helpless_subcmd_parser.description.lower()
+ )
def helpless_subcmd_func(self, args: argparse.Namespace):
# Make sure vars(Namespace) works. The way we originally added cmd2_hander to it resulted in a RecursionError.
self.poutput(vars(args))
@@ -453,11 +450,7 @@ def test_pytest_mock_invalid(mocker):
app = ArgparseApp()
-@pytest.mark.parametrize('spec_param', [
- {'spec': True},
- {'spec_set': True},
- {'autospec': True},
-])
+@pytest.mark.parametrize('spec_param', [{'spec': True}, {'spec_set': True}, {'autospec': True},])
def test_pytest_mock_valid(mocker, spec_param):
mocker.patch.object(ArgparseApp, 'namespace_provider', **spec_param)
app = ArgparseApp()