Debian Codegraph @

test/units/plugins/become/conftest.py

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