mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-07 10:05:18 +01:00
Fix deprecated imports in tests/unit/modules/conftest.py
Replace deprecated module_utils imports: - ansible.module_utils._text -> ansible.module_utils.common.text.converters - ansible.module_utils.six.string_types -> str - ansible.module_utils.common._collections_compat -> collections.abc Fixes #686 Co-authored-by: Cursor AI Signed-off-by: Pavel Bar <pbar@redhat.com>
This commit is contained in:
parent
ab24f41cbd
commit
7bc21b6b41
2 changed files with 4 additions and 5 deletions
|
|
@ -1,2 +1 @@
|
|||
tests/utils/shippable/timing.py shebang
|
||||
tests/unit/modules/conftest.py pylint:ansible-bad-import-from
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import json
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
from collections.abc import MutableMapping
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def patch_ansible_module(request, mocker):
|
||||
if isinstance(request.param, string_types):
|
||||
if isinstance(request.param, str):
|
||||
args = request.param
|
||||
elif isinstance(request.param, MutableMapping):
|
||||
if 'ANSIBLE_MODULE_ARGS' not in request.param:
|
||||
|
|
|
|||
Loading…
Reference in a new issue