mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Fix test errors running locally with Ansible devel
This commit is contained in:
@@ -209,3 +209,19 @@ def vault_credential(organization):
|
||||
credential_type=ct, name='vault-cred',
|
||||
inputs={'vault_id': 'foo', 'vault_password': 'pas4word'}
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def silence_deprecation():
|
||||
"""The deprecation warnings are stored in a global variable
|
||||
they will create cross-test interference. Use this to turn them off.
|
||||
"""
|
||||
with mock.patch('ansible.module_utils.basic.AnsibleModule.deprecate'):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def silence_warning():
|
||||
"""Warnings use global variable, same as deprecations."""
|
||||
with mock.patch('ansible.module_utils.basic.AnsibleModule.warn'):
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user