From 9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 4 Apr 2022 20:42:14 +0200 Subject: Merging upstream version 2.18.1. Signed-off-by: Daniel Baumann --- tests/main_test.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'tests/main_test.py') diff --git a/tests/main_test.py b/tests/main_test.py index 1ad8d41..a645300 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import os.path from unittest import mock @@ -12,20 +14,6 @@ from testing.auto_namedtuple import auto_namedtuple from testing.util import cwd -@pytest.mark.parametrize( - ('argv', 'expected'), - ( - ((), ['f']), - (('--f', 'x'), ['x']), - (('--f', 'x', '--f', 'y'), ['x', 'y']), - ), -) -def test_append_replace_default(argv, expected): - parser = argparse.ArgumentParser() - parser.add_argument('--f', action=main.AppendReplaceDefault, default=['f']) - assert parser.parse_args(argv).f == expected - - def _args(**kwargs): kwargs.setdefault('command', 'help') kwargs.setdefault('config', C.CONFIG_FILE) @@ -170,7 +158,7 @@ def test_init_templatedir(mock_store_dir): assert patch.call_count == 1 assert 'tdir' in patch.call_args[0] - assert patch.call_args[1]['hook_types'] == ['pre-commit'] + assert patch.call_args[1]['hook_types'] is None assert patch.call_args[1]['skip_on_missing_config'] is True -- cgit v1.2.3