mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Python 3.8 collections compatibility fixes.
Includes a new pylint blacklist plugin to prevent regressions.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
import json
|
||||
import sys
|
||||
from collections import MutableMapping
|
||||
from io import BytesIO
|
||||
|
||||
import pytest
|
||||
@@ -11,6 +10,7 @@ import pytest
|
||||
import ansible.module_utils.basic
|
||||
from ansible.module_utils.six import PY3, string_types
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
import json
|
||||
from collections import MutableMapping
|
||||
|
||||
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
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import collections
|
||||
from io import BytesIO
|
||||
|
||||
from ansible.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
|
||||
|
||||
def pass_function(*args, **kwargs):
|
||||
@@ -145,4 +145,4 @@ def test__get_json_data(mocker):
|
||||
"{url}".format(url=GITHUB_DATA['url']),
|
||||
'CSRF')
|
||||
|
||||
assert isinstance(json_data, collections.Mapping)
|
||||
assert isinstance(json_data, Mapping)
|
||||
|
||||
@@ -22,12 +22,11 @@ __metaclass__ = type
|
||||
|
||||
from io import StringIO
|
||||
|
||||
from collections import Sequence, Set, Mapping
|
||||
|
||||
from ansible.compat.tests import unittest
|
||||
|
||||
from ansible import errors
|
||||
from ansible.module_utils.six import text_type, binary_type
|
||||
from ansible.module_utils.common._collections_compat import Sequence, Set, Mapping
|
||||
from ansible.parsing.yaml.loader import AnsibleLoader
|
||||
from ansible.parsing import vault
|
||||
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import collections
|
||||
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.compat.tests.mock import patch, MagicMock
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleParserError
|
||||
from ansible.module_utils.common._collections_compat import Container
|
||||
from ansible.playbook.block import Block
|
||||
from ansible.playbook.task import Task
|
||||
|
||||
@@ -97,7 +96,7 @@ class TestHashParams(unittest.TestCase):
|
||||
|
||||
def test_container_but_not_iterable(self):
|
||||
# This is a Container that is not iterable, which is unlikely but...
|
||||
class MyContainer(collections.Container):
|
||||
class MyContainer(Container):
|
||||
def __init__(self, some_thing):
|
||||
self.data = []
|
||||
self.data.append(some_thing)
|
||||
|
||||
Reference in New Issue
Block a user