diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-04 18:42:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-04 18:42:30 +0000 |
commit | 9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3 (patch) | |
tree | a6d016823a24941dd795d30ba84409db12aa41cb /tests/main_test.py | |
parent | Releasing debian version 2.17.0-1. (diff) | |
download | pre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.tar.xz pre-commit-9d68e4e3da4ce68e28506d926c7de9fd6ffbf6a3.zip |
Merging upstream version 2.18.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/main_test.py')
-rw-r--r-- | tests/main_test.py | 18 |
1 files changed, 3 insertions, 15 deletions
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 |