diff --git a/.zuul.yaml b/.zuul.yaml index 34184f1..fd189e2 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,3 @@ - project: templates: - - python35-charm-jobs - openstack-python3-ussuri-jobs diff --git a/test-requirements.txt b/test-requirements.txt index f853625..0aabe17 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,11 +13,6 @@ setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb requests>=2.18.4 -# Newer mock seems to have some syntax which is newer than python3.5 (e.g. -# f'{something}' -mock>=1.2,<4.0.0; python_version < '3.6' -mock>=1.2; python_version >= '3.6' - stestr>=2.2.0 # Dependency of stestr. Workaround for diff --git a/unit_tests/test_actions.py b/unit_tests/test_actions.py index 6f37c83..d921671 100644 --- a/unit_tests/test_actions.py +++ b/unit_tests/test_actions.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock -from mock import patch +from unittest import mock +from unittest.mock import patch from test_utils import CharmTestCase diff --git a/unit_tests/test_actions_openstack_upgrade.py b/unit_tests/test_actions_openstack_upgrade.py index e884cde..b151d0f 100644 --- a/unit_tests/test_actions_openstack_upgrade.py +++ b/unit_tests/test_actions_openstack_upgrade.py @@ -15,7 +15,7 @@ import os import sys -from mock import patch, MagicMock +from unittest.mock import patch, MagicMock # python-apt is not installed as part of test-requirements but is imported by # some charmhelpers modules so create a fake import. diff --git a/unit_tests/test_ceilometer_contexts.py b/unit_tests/test_ceilometer_contexts.py index 882bbc4..f74df98 100644 --- a/unit_tests/test_ceilometer_contexts.py +++ b/unit_tests/test_ceilometer_contexts.py @@ -13,7 +13,7 @@ # limitations under the License. import collections -from mock import patch, MagicMock +from unittest.mock import patch, MagicMock import ceilometer_contexts as contexts import ceilometer_utils as utils diff --git a/unit_tests/test_ceilometer_hooks.py b/unit_tests/test_ceilometer_hooks.py index a45d3d4..504e204 100644 --- a/unit_tests/test_ceilometer_hooks.py +++ b/unit_tests/test_ceilometer_hooks.py @@ -16,7 +16,7 @@ import copy import os import sys -from mock import patch, MagicMock, call, mock_open +from unittest.mock import patch, MagicMock, call, mock_open # python-apt is not installed as part of test-requirements but is imported by # some charmhelpers modules so create a fake import. diff --git a/unit_tests/test_ceilometer_utils.py b/unit_tests/test_ceilometer_utils.py index 2a6dedd..07b78e9 100644 --- a/unit_tests/test_ceilometer_utils.py +++ b/unit_tests/test_ceilometer_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mock import patch, call, MagicMock +from unittest.mock import patch, call, MagicMock import ceilometer_utils as utils diff --git a/unit_tests/test_utils.py b/unit_tests/test_utils.py index 8ee463f..8ab0afe 100644 --- a/unit_tests/test_utils.py +++ b/unit_tests/test_utils.py @@ -19,7 +19,7 @@ import yaml import io from contextlib import contextmanager -from mock import patch +from unittest.mock import patch @contextmanager