Debian Codegraph @

ansible_collections/community/general/tests/unit/plugins/become/conftest.py

raw
1 # Copyright (c) 2012-2014, Michael DeHaan <[email protected]>
2 # Copyright (c) 2017 Ansible Project
3 #
4 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
5 # SPDX-License-Identifier: GPL-3.0-or-later
6
7 # Make coding more python3-ish
8 from __future__ import annotations
9
10 import pytest
11 from ansible.cli.arguments import option_helpers as opt_help
12 from ansible.utils import context_objects as co
13
14
15 @pytest.fixture
16 def parser():
17 parser = opt_help.create_base_parser("testparser")
18
19 opt_help.add_runas_options(parser)
20 opt_help.add_meta_options(parser)
21 opt_help.add_runtask_options(parser)
22 opt_help.add_vault_options(parser)
23 opt_help.add_async_options(parser)
24 opt_help.add_connect_options(parser)
25 opt_help.add_subset_options(parser)
26 opt_help.add_check_options(parser)
27 opt_help.add_inventory_options(parser)
28
29 return parser
30
31
32 @pytest.fixture
33 def reset_cli_args():
34 co.GlobalCLIArgs._Singleton__instance = None
35 yield
36 co.GlobalCLIArgs._Singleton__instance = None