diff --git a/build/common_virtualenv_packages.txt b/build/common_virtualenv_packages.txt index 45d20dbff073..278513b879bf 100644 --- a/build/common_virtualenv_packages.txt +++ b/build/common_virtualenv_packages.txt @@ -64,7 +64,6 @@ mozilla.pth:third_party/python/jsmin mozilla.pth:third_party/python/json-e mozilla.pth:third_party/python/jsonschema mozilla.pth:third_party/python/MarkupSafe/src -mozilla.pth:third_party/python/mock-1.0.0 mozilla.pth:third_party/python/mohawk mozilla.pth:third_party/python/more-itertools mozilla.pth:third_party/python/mozilla-version diff --git a/python/mach/mach/telemetry_interface.py b/python/mach/mach/telemetry_interface.py index c57032848b6c..262ddb2937e7 100644 --- a/python/mach/mach/telemetry_interface.py +++ b/python/mach/mach/telemetry_interface.py @@ -5,7 +5,7 @@ from __future__ import print_function, absolute_import import sys -from mock import Mock +from unittest.mock import Mock class NoopTelemetry(object): @@ -38,9 +38,7 @@ class GleanTelemetry(object): during this mach invocation. """ - def __init__( - self, - ): + def __init__(self,): self._metrics_cache = {} def metrics(self, metrics_path): diff --git a/python/mach/mach/test/test_decorators.py b/python/mach/mach/test/test_decorators.py index f4a82d126042..35cf1a74791b 100644 --- a/python/mach/mach/test/test_decorators.py +++ b/python/mach/mach/test/test_decorators.py @@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals import os import pytest -from mock import Mock +from unittest.mock import Mock from mozbuild.base import MachCommandBase from mozunit import main diff --git a/python/mach/mach/test/test_entry_point.py b/python/mach/mach/test/test_entry_point.py index 0a6b3134176f..936890ce59bf 100644 --- a/python/mach/mach/test/test_entry_point.py +++ b/python/mach/mach/test/test_entry_point.py @@ -10,7 +10,7 @@ import sys from mach.base import MachError from mach.test.conftest import TestBase -from mock import patch +from unittest.mock import patch from mozunit import main diff --git a/python/mozbuild/mozbuild/test/code_analysis/test_mach_commands.py b/python/mozbuild/mozbuild/test/code_analysis/test_mach_commands.py index 015f0b7e40e5..1e58e6e274f3 100644 --- a/python/mozbuild/mozbuild/test/code_analysis/test_mach_commands.py +++ b/python/mozbuild/mozbuild/test/code_analysis/test_mach_commands.py @@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals, print_function import os import unittest -import mock +from unittest import mock from mozunit import main from mach.registrar import Registrar diff --git a/python/mozbuild/mozbuild/test/configure/test_checks_configure.py b/python/mozbuild/mozbuild/test/configure/test_checks_configure.py index 3d5a9ef62553..16717499f118 100644 --- a/python/mozbuild/mozbuild/test/configure/test_checks_configure.py +++ b/python/mozbuild/mozbuild/test/configure/test_checks_configure.py @@ -4,32 +4,22 @@ from __future__ import absolute_import, print_function, unicode_literals -from mock import patch +from unittest.mock import patch from six import StringIO import os import sys import textwrap import unittest -from mozunit import ( - main, - MockedOpen, -) +from mozunit import main, MockedOpen -from mozbuild.configure import ( - ConfigureError, - ConfigureSandbox, -) +from mozbuild.configure import ConfigureError, ConfigureSandbox from mozbuild.util import exec_ from mozbuild.shellutil import quote as shell_quote from mozpack import path as mozpath from buildconfig import topsrcdir -from common import ( - ConfigureTestSandbox, - ensure_exe_extension, - fake_short_path, -) +from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path class TestChecksConfigure(unittest.TestCase): @@ -119,11 +109,7 @@ class TestChecksConfigure(unittest.TestCase): ): config = {} out = StringIO() - paths = { - self.KNOWN_A: None, - self.KNOWN_B: None, - self.KNOWN_C: None, - } + paths = {self.KNOWN_A: None, self.KNOWN_B: None, self.KNOWN_C: None} if extra_paths: paths.update(extra_paths) environ = dict(environ) @@ -624,13 +610,7 @@ class TestChecksConfigure(unittest.TestCase): config, out, status = run_configure_java(paths) self.assertEqual(status, 0) - self.assertEqual( - config, - { - "JAVA": java, - "MOZ_JAVA_CODE_COVERAGE": False, - }, - ) + self.assertEqual(config, {"JAVA": java, "MOZ_JAVA_CODE_COVERAGE": False}) self.assertEqual( out, textwrap.dedent( @@ -650,13 +630,7 @@ class TestChecksConfigure(unittest.TestCase): alt_path = mozpath.dirname(java) config, out, status = run_configure_java(paths, alt_java_home, alt_path) self.assertEqual(status, 0) - self.assertEqual( - config, - { - "JAVA": alt_java, - "MOZ_JAVA_CODE_COVERAGE": False, - }, - ) + self.assertEqual(config, {"JAVA": alt_java, "MOZ_JAVA_CODE_COVERAGE": False}) self.assertEqual( out, textwrap.dedent( @@ -675,13 +649,7 @@ class TestChecksConfigure(unittest.TestCase): args=["--with-java-bin-path=%s" % mozpath.dirname(alt_java)], ) self.assertEqual(status, 0) - self.assertEqual( - config, - { - "JAVA": alt_java, - "MOZ_JAVA_CODE_COVERAGE": False, - }, - ) + self.assertEqual(config, {"JAVA": alt_java, "MOZ_JAVA_CODE_COVERAGE": False}) self.assertEqual( out, textwrap.dedent( @@ -701,13 +669,7 @@ class TestChecksConfigure(unittest.TestCase): args=["--with-java-bin-path=%s" % mozpath.dirname(alt_java)], ) self.assertEqual(status, 0) - self.assertEqual( - config, - { - "JAVA": alt_java, - "MOZ_JAVA_CODE_COVERAGE": False, - }, - ) + self.assertEqual(config, {"JAVA": alt_java, "MOZ_JAVA_CODE_COVERAGE": False}) self.assertEqual( out, textwrap.dedent( @@ -727,13 +689,7 @@ class TestChecksConfigure(unittest.TestCase): args=["--enable-java-coverage"], ) self.assertEqual(status, 0) - self.assertEqual( - config, - { - "JAVA": java, - "MOZ_JAVA_CODE_COVERAGE": True, - }, - ) + self.assertEqual(config, {"JAVA": java, "MOZ_JAVA_CODE_COVERAGE": True}) # Any missing tool is fatal when these checks run. paths = {} @@ -806,9 +762,7 @@ and/or set $JAVA_HOME. includes=(), ) - extra_paths = { - mock_pkg_config_path: mock_pkg_config, - } + extra_paths = {mock_pkg_config_path: mock_pkg_config} config, output, status = get_result("pkg_check_modules('MOZ_VALID', 'valid')") self.assertEqual(status, 1) @@ -869,12 +823,7 @@ and/or set $JAVA_HOME. % (mock_pkg_config_path, mock_pkg_config_version) ), ) - self.assertEqual( - config, - { - "PKG_CONFIG": mock_pkg_config_path, - }, - ) + self.assertEqual(config, {"PKG_CONFIG": mock_pkg_config_path}) config, output, status = get_result( "pkg_check_modules('MOZ_NEW', 'new > 1.1')", extra_paths=extra_paths @@ -892,12 +841,7 @@ and/or set $JAVA_HOME. % (mock_pkg_config_path, mock_pkg_config_version) ), ) - self.assertEqual( - config, - { - "PKG_CONFIG": mock_pkg_config_path, - }, - ) + self.assertEqual(config, {"PKG_CONFIG": mock_pkg_config_path}) # allow_missing makes missing packages non-fatal. cmd = textwrap.dedent( @@ -925,12 +869,7 @@ and/or set $JAVA_HOME. % (mock_pkg_config_path, mock_pkg_config_version) ), ) - self.assertEqual( - config, - { - "PKG_CONFIG": mock_pkg_config_path, - }, - ) + self.assertEqual(config, {"PKG_CONFIG": mock_pkg_config_path}) config, output, status = get_result( cmd, args=["--disable-compile-environment"], extra_paths=extra_paths @@ -944,9 +883,7 @@ and/or set $JAVA_HOME. return 0, "0.8.10", "" self.fail("Unexpected arguments to mock_old_pkg_config: %s" % args) - extra_paths = { - mock_pkg_config_path: mock_old_pkg_config, - } + extra_paths = {mock_pkg_config_path: mock_old_pkg_config} config, output, status = get_result( "pkg_check_modules('MOZ_VALID', 'valid')", extra_paths=extra_paths @@ -979,12 +916,7 @@ and/or set $JAVA_HOME. """ ), ) - self.assertEqual( - config, - { - "MOZ_MOZILLA_API_KEY": "no-mozilla-api-key", - }, - ) + self.assertEqual(config, {"MOZ_MOZILLA_API_KEY": "no-mozilla-api-key"}) config, output, status = self.get_result( "simple_keyfile('Mozilla API')", @@ -1036,12 +968,7 @@ and/or set $JAVA_HOME. """ ), ) - self.assertEqual( - config, - { - "MOZ_MOZILLA_API_KEY": "fake-key", - }, - ) + self.assertEqual(config, {"MOZ_MOZILLA_API_KEY": "fake-key"}) with MockedOpen({"default": "default-key\n"}): config, output, status = self.get_result( @@ -1056,12 +983,7 @@ and/or set $JAVA_HOME. """ ), ) - self.assertEqual( - config, - { - "MOZ_MOZILLA_API_KEY": "default-key", - }, - ) + self.assertEqual(config, {"MOZ_MOZILLA_API_KEY": "default-key"}) with MockedOpen({"default": "default-key\n", "key": "fake-key\n"}): config, output, status = self.get_result( @@ -1076,12 +998,7 @@ and/or set $JAVA_HOME. """ ), ) - self.assertEqual( - config, - { - "MOZ_MOZILLA_API_KEY": "fake-key", - }, - ) + self.assertEqual(config, {"MOZ_MOZILLA_API_KEY": "fake-key"}) def test_id_and_secret_keyfile(self): includes = ("util.configure", "checks.configure", "keyfiles.configure") @@ -1158,10 +1075,7 @@ and/or set $JAVA_HOME. ) self.assertEqual( config, - { - "MOZ_BING_API_CLIENTID": "fake-id", - "MOZ_BING_API_KEY": "fake-key", - }, + {"MOZ_BING_API_CLIENTID": "fake-id", "MOZ_BING_API_KEY": "fake-key"}, ) with MockedOpen({"key": "fake-key\n"}): @@ -1223,10 +1137,7 @@ and/or set $JAVA_HOME. ) self.assertEqual( config, - { - "MOZ_BING_API_CLIENTID": "fake-id", - "MOZ_BING_API_KEY": "fake-key", - }, + {"MOZ_BING_API_CLIENTID": "fake-id", "MOZ_BING_API_KEY": "fake-key"}, ) diff --git a/python/mozbuild/mozbuild/test/test_telemetry_settings.py b/python/mozbuild/mozbuild/test/test_telemetry_settings.py index f1c42e6b85f2..a357d185b267 100644 --- a/python/mozbuild/mozbuild/test/test_telemetry_settings.py +++ b/python/mozbuild/mozbuild/test/test_telemetry_settings.py @@ -9,7 +9,7 @@ from unittest.mock import Mock import pytest -import mock +from unittest import mock import mozunit import requests @@ -25,18 +25,11 @@ from mozbuild.settings import TelemetrySettings @SettingsProvider class OtherSettings: - config_settings = [ - ("foo.bar", "int", "", 1), - ("build.abc", "string", "", ""), - ] + config_settings = [("foo.bar", "int", "", 1), ("build.abc", "string", "", "")] def record_enabled_telemetry(mozbuild_path, settings): - record_telemetry_settings( - settings, - mozbuild_path, - True, - ) + record_telemetry_settings(settings, mozbuild_path, True) @pytest.fixture @@ -166,8 +159,7 @@ def test_resolve_is_employee(): "mach.telemetry.resolve_is_employee_by_credentials", return_value=is_employee_bugzilla, ), mock.patch( - "mach.telemetry.resolve_is_employee_by_vcs", - return_value=is_employee_vcs, + "mach.telemetry.resolve_is_employee_by_vcs", return_value=is_employee_vcs ): return resolve_is_employee(None) diff --git a/python/mozbuild/mozbuild/test/test_vendor.py b/python/mozbuild/mozbuild/test/test_vendor.py index 04e280e81a08..d52349167f82 100644 --- a/python/mozbuild/mozbuild/test/test_vendor.py +++ b/python/mozbuild/mozbuild/test/test_vendor.py @@ -10,7 +10,7 @@ import subprocess import tempfile from buildconfig import topsrcdir -from mock import Mock +from unittest.mock import Mock from mozbuild.vendor.vendor_python import VendorPython import mozunit diff --git a/python/mozperftest/mozperftest/tests/test_notebookupload.py b/python/mozperftest/mozperftest/tests/test_notebookupload.py index 533dfb90aa2f..bb7613032368 100644 --- a/python/mozperftest/mozperftest/tests/test_notebookupload.py +++ b/python/mozperftest/mozperftest/tests/test_notebookupload.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import pytest -import mock +from unittest import mock import mozunit from mozperftest.environment import METRICS from mozperftest.tests.support import BT_DATA, EXAMPLE_TEST, get_running_env, temp_file diff --git a/python/mozperftest/mozperftest/tests/test_perftestnotebook.py b/python/mozperftest/mozperftest/tests/test_perftestnotebook.py index d7f84c9d50c1..0154fe15c20e 100644 --- a/python/mozperftest/mozperftest/tests/test_perftestnotebook.py +++ b/python/mozperftest/mozperftest/tests/test_perftestnotebook.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from pathlib import Path import pytest -import mock +from unittest import mock import mozunit from mozperftest.metrics.notebook.constant import Constant diff --git a/taskcluster/taskgraph/test/test_actions_util.py b/taskcluster/taskgraph/test/test_actions_util.py index de5a6ca7eea0..8d5d0f9ec012 100644 --- a/taskcluster/taskgraph/test/test_actions_util.py +++ b/taskcluster/taskgraph/test/test_actions_util.py @@ -9,7 +9,7 @@ import json from pprint import pprint import pytest -from mock import patch +from unittest.mock import patch from mozunit import main, MockedOpen from taskgraph import actions, create diff --git a/taskcluster/taskgraph/test/test_create.py b/taskcluster/taskgraph/test/test_create.py index db1c27437735..580cb7e2726c 100644 --- a/taskcluster/taskgraph/test/test_create.py +++ b/taskcluster/taskgraph/test/test_create.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, print_function, unicode_literals import unittest -import mock +from unittest import mock from taskgraph import create from taskgraph.config import GraphConfig diff --git a/taskcluster/taskgraph/test/test_decision.py b/taskcluster/taskgraph/test/test_decision.py index 26dfdb714c23..e004ed00f013 100644 --- a/taskcluster/taskgraph/test/test_decision.py +++ b/taskcluster/taskgraph/test/test_decision.py @@ -10,7 +10,7 @@ import shutil import unittest import tempfile -from mock import patch +from unittest.mock import patch from mozunit import main, MockedOpen from taskgraph import decision from taskgraph.util.yaml import load_yaml diff --git a/taskcluster/taskgraph/test/test_util_docker.py b/taskcluster/taskgraph/test/test_util_docker.py index 1a81d9b9ef6e..7b7bb002b71a 100644 --- a/taskcluster/taskgraph/test/test_util_docker.py +++ b/taskcluster/taskgraph/test/test_util_docker.py @@ -10,7 +10,7 @@ import stat import tarfile import tempfile import unittest -import mock +from unittest import mock import taskcluster_urls as liburls from taskgraph.util import docker diff --git a/taskcluster/taskgraph/test/test_util_parameterization.py b/taskcluster/taskgraph/test/test_util_parameterization.py index 73b6a98b5ebe..8c8bc41ade43 100644 --- a/taskcluster/taskgraph/test/test_util_parameterization.py +++ b/taskcluster/taskgraph/test/test_util_parameterization.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, print_function, unicode_literals import unittest import datetime -import mock +from unittest import mock import os from mozunit import main diff --git a/testing/mozbase/mozdevice/tests/conftest.py b/testing/mozbase/mozdevice/tests/conftest.py index 9b43534a3de7..10e8fced1f34 100644 --- a/testing/mozbase/mozdevice/tests/conftest.py +++ b/testing/mozbase/mozdevice/tests/conftest.py @@ -5,7 +5,7 @@ from random import randint, seed import mozdevice import pytest -from mock import patch +from unittest.mock import patch from six import StringIO # set up required module-level variables/objects diff --git a/testing/mozbase/mozdevice/tests/test_chown.py b/testing/mozbase/mozdevice/tests/test_chown.py index 2755b3cf1d90..8201762feb41 100644 --- a/testing/mozbase/mozdevice/tests/test_chown.py +++ b/testing/mozbase/mozdevice/tests/test_chown.py @@ -4,7 +4,7 @@ from __future__ import absolute_import import logging -from mock import patch +from unittest.mock import patch import mozunit import pytest diff --git a/testing/mozbase/mozgeckoprofiler/tests/test_view_gecko_profiler.py b/testing/mozbase/mozgeckoprofiler/tests/test_view_gecko_profiler.py index e5af9f86d88e..7541ab253e1c 100644 --- a/testing/mozbase/mozgeckoprofiler/tests/test_view_gecko_profiler.py +++ b/testing/mozbase/mozgeckoprofiler/tests/test_view_gecko_profiler.py @@ -12,7 +12,7 @@ import requests import threading import time import re -import mock +from unittest import mock import six from mozgeckoprofiler import view_gecko_profile diff --git a/testing/mozbase/mozinfo/tests/test.py b/testing/mozbase/mozinfo/tests/test.py index 902b0a48f0e2..eaab416e16f0 100644 --- a/testing/mozbase/mozinfo/tests/test.py +++ b/testing/mozbase/mozinfo/tests/test.py @@ -7,7 +7,7 @@ from __future__ import absolute_import import json -import mock +from unittest import mock import os import shutil import sys diff --git a/testing/mozbase/moznetwork/tests/test_moznetwork.py b/testing/mozbase/moznetwork/tests/test_moznetwork.py index 53c0e2497de5..f2a96de9de04 100644 --- a/testing/mozbase/moznetwork/tests/test_moznetwork.py +++ b/testing/mozbase/moznetwork/tests/test_moznetwork.py @@ -12,7 +12,7 @@ from distutils.spawn import find_executable import moznetwork import pytest -import mock +from unittest import mock import mozinfo import mozunit diff --git a/testing/mozbase/mozpower/tests/conftest.py b/testing/mozbase/mozpower/tests/conftest.py index 5d8ecbbc9db9..9d543775620c 100644 --- a/testing/mozbase/mozpower/tests/conftest.py +++ b/testing/mozbase/mozpower/tests/conftest.py @@ -1,6 +1,6 @@ from __future__ import absolute_import, print_function -import mock +from unittest import mock import os import pytest import tempfile diff --git a/testing/mozbase/mozpower/tests/test_intelpowergadget.py b/testing/mozbase/mozpower/tests/test_intelpowergadget.py index f508c83915ad..e04966c36b23 100644 --- a/testing/mozbase/mozpower/tests/test_intelpowergadget.py +++ b/testing/mozbase/mozpower/tests/test_intelpowergadget.py @@ -3,7 +3,7 @@ from __future__ import absolute_import import datetime -import mock +from unittest import mock import mozunit import os import pytest diff --git a/testing/mozbase/mozpower/tests/test_macintelpower.py b/testing/mozbase/mozpower/tests/test_macintelpower.py index 72fb6767f29e..8f0450d5791f 100644 --- a/testing/mozbase/mozpower/tests/test_macintelpower.py +++ b/testing/mozbase/mozpower/tests/test_macintelpower.py @@ -2,7 +2,7 @@ from __future__ import absolute_import -import mock +from unittest import mock import mozunit import time diff --git a/testing/mozbase/mozpower/tests/test_mozpower.py b/testing/mozbase/mozpower/tests/test_mozpower.py index 99a92abaef60..fcc9586f5aba 100644 --- a/testing/mozbase/mozpower/tests/test_mozpower.py +++ b/testing/mozbase/mozpower/tests/test_mozpower.py @@ -2,7 +2,7 @@ from __future__ import absolute_import -import mock +from unittest import mock import mozunit import pytest import subprocess diff --git a/testing/mozbase/mozpower/tests/test_powerbase.py b/testing/mozbase/mozpower/tests/test_powerbase.py index 7fe14c97d432..ca974741cf53 100644 --- a/testing/mozbase/mozpower/tests/test_powerbase.py +++ b/testing/mozbase/mozpower/tests/test_powerbase.py @@ -2,7 +2,7 @@ from __future__ import absolute_import -import mock +from unittest import mock import mozunit import pytest diff --git a/testing/mozbase/mozproxy/tests/test_mitm_addons.py b/testing/mozbase/mozproxy/tests/test_mitm_addons.py index bcde35fc81c4..53ff839e9733 100644 --- a/testing/mozbase/mozproxy/tests/test_mitm_addons.py +++ b/testing/mozbase/mozproxy/tests/test_mitm_addons.py @@ -4,7 +4,7 @@ from __future__ import absolute_import, print_function import json import os -import mock +from unittest import mock import mozunit here = os.path.dirname(__file__) diff --git a/testing/mozbase/mozproxy/tests/test_proxy.py b/testing/mozbase/mozproxy/tests/test_proxy.py index f9b80aeb8a2a..ee168749ae9c 100644 --- a/testing/mozbase/mozproxy/tests/test_proxy.py +++ b/testing/mozbase/mozproxy/tests/test_proxy.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, print_function import os -import mock +from unittest import mock import mozunit import mozinfo import requests diff --git a/testing/mozbase/mozproxy/tests/test_utils.py b/testing/mozbase/mozproxy/tests/test_utils.py index 967517c0f1dc..0b62f3487294 100644 --- a/testing/mozbase/mozproxy/tests/test_utils.py +++ b/testing/mozbase/mozproxy/tests/test_utils.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, print_function import os import shutil -import mock +from unittest import mock import mozunit from mozproxy.utils import download_file_from_url diff --git a/testing/mozbase/mozrunner/tests/test_crash.py b/testing/mozbase/mozrunner/tests/test_crash.py index 43760e757fc4..61a7b3c42865 100644 --- a/testing/mozbase/mozrunner/tests/test_crash.py +++ b/testing/mozbase/mozrunner/tests/test_crash.py @@ -5,7 +5,7 @@ from __future__ import absolute_import -from mock import patch +from unittest.mock import patch import mozunit import pytest diff --git a/testing/mozbase/mozrunner/tests/test_start.py b/testing/mozbase/mozrunner/tests/test_start.py index 2e4b11133a86..b584f2e4bc76 100644 --- a/testing/mozbase/mozrunner/tests/test_start.py +++ b/testing/mozbase/mozrunner/tests/test_start.py @@ -5,7 +5,7 @@ from __future__ import absolute_import from time import sleep import mozunit -from mock import patch +from unittest.mock import patch from pytest import raises from mozrunner import RunnerNotStartedError diff --git a/testing/mozharness/test/test_base_diskutils.py b/testing/mozharness/test/test_base_diskutils.py index 2a4efc02dd71..77ee4b453f58 100644 --- a/testing/mozharness/test/test_base_diskutils.py +++ b/testing/mozharness/test/test_base_diskutils.py @@ -1,5 +1,5 @@ from __future__ import absolute_import -import mock +from unittest import mock import unittest from mozharness.base.diskutils import convert_to, DiskutilsError, DiskSize, DiskInfo diff --git a/testing/mozharness/test/test_base_script.py b/testing/mozharness/test/test_base_script.py index ff6163ff46de..5d2164c96207 100644 --- a/testing/mozharness/test/test_base_script.py +++ b/testing/mozharness/test/test_base_script.py @@ -1,7 +1,7 @@ from __future__ import absolute_import, print_function import gc -import mock +from unittest import mock import os import re import shutil diff --git a/testing/mozharness/test/test_l10n_locales.py b/testing/mozharness/test/test_l10n_locales.py index 7b772329a0ae..ce9ad36b8ca5 100644 --- a/testing/mozharness/test/test_l10n_locales.py +++ b/testing/mozharness/test/test_l10n_locales.py @@ -3,7 +3,7 @@ import os import shutil import unittest -import mock +from unittest import mock import mozharness.base.script as script import mozharness.mozilla.l10n.locales as locales diff --git a/testing/mozharness/tox.ini b/testing/mozharness/tox.ini index 7e98dac340d0..35d12eb27951 100644 --- a/testing/mozharness/tox.ini +++ b/testing/mozharness/tox.ini @@ -8,7 +8,6 @@ deps = nose rednose {toxinidir}/../mozbase/mozlog - {toxinidir}/../../third_party/python/mock-1.0.0/ mozbase = {toxinidir}/../mozbase/ diff --git a/testing/raptor/test/test_control_server.py b/testing/raptor/test/test_control_server.py index 2b25976bed6c..ccb2fd702a0c 100644 --- a/testing/raptor/test/test_control_server.py +++ b/testing/raptor/test/test_control_server.py @@ -4,7 +4,7 @@ import mozunit import os import requests import sys -import mock +from unittest import mock import shutil try: diff --git a/testing/raptor/test/test_cpu.py b/testing/raptor/test/test_cpu.py index 7197ba34cdc6..e507f40201cc 100644 --- a/testing/raptor/test/test_cpu.py +++ b/testing/raptor/test/test_cpu.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, division, unicode_literals import os import sys -import mock +from unittest import mock import mozunit # need this so the raptor unit tests can find output & filter classes diff --git a/testing/raptor/test/test_power.py b/testing/raptor/test/test_power.py index ade1d4e81244..f498a19661bd 100644 --- a/testing/raptor/test/test_power.py +++ b/testing/raptor/test/test_power.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, unicode_literals import sys import os -import mock +from unittest import mock import tempfile import mozunit diff --git a/testing/raptor/test/test_raptor.py b/testing/raptor/test/test_raptor.py index 8d45747805a4..0e8f7b0484eb 100644 --- a/testing/raptor/test/test_raptor.py +++ b/testing/raptor/test/test_raptor.py @@ -5,9 +5,9 @@ import sys import threading import time import traceback -import mock +from unittest import mock import pytest -from mock import Mock +from unittest.mock import Mock from six import reraise import mozunit diff --git a/testing/talos/talos/unittests/test_config.py b/testing/talos/talos/unittests/test_config.py index 0d9d469f7523..e8cfc3e47ffc 100644 --- a/testing/talos/talos/unittests/test_config.py +++ b/testing/talos/talos/unittests/test_config.py @@ -3,7 +3,7 @@ from __future__ import absolute_import import copy import os -import mock +from unittest import mock import mozunit import pytest diff --git a/toolkit/crashreporter/tools/unit-symbolstore.py b/toolkit/crashreporter/tools/unit-symbolstore.py index 94861c2d229a..f11e3539f5f1 100755 --- a/toolkit/crashreporter/tools/unit-symbolstore.py +++ b/toolkit/crashreporter/tools/unit-symbolstore.py @@ -3,7 +3,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import mock +from unittest import mock import mozunit import os import shutil @@ -14,7 +14,7 @@ import tempfile import unittest import buildconfig -from mock import patch +from unittest.mock import patch from mozpack.manifests import InstallManifest import mozpack.path as mozpath diff --git a/tools/lint/test/test_perfdocs.py b/tools/lint/test/test_perfdocs.py index 3ebbe884c2fd..2d0592553cca 100644 --- a/tools/lint/test/test_perfdocs.py +++ b/tools/lint/test/test_perfdocs.py @@ -1,5 +1,5 @@ import contextlib -import mock +from unittest import mock import os import pytest import shutil diff --git a/tools/lint/test/test_perfdocs_generation.py b/tools/lint/test/test_perfdocs_generation.py index 2468ad06b312..ea230be2a157 100644 --- a/tools/lint/test/test_perfdocs_generation.py +++ b/tools/lint/test/test_perfdocs_generation.py @@ -1,5 +1,5 @@ import contextlib -import mock +from unittest import mock import os import shutil import tempfile diff --git a/tools/tryselect/test/conftest.py b/tools/tryselect/test/conftest.py index a2c697d8fb4b..8dfe0ec96672 100644 --- a/tools/tryselect/test/conftest.py +++ b/tools/tryselect/test/conftest.py @@ -8,7 +8,7 @@ import os import pytest import yaml -from mock import MagicMock +from unittest.mock import MagicMock from moztest.resolve import TestResolver from taskgraph.graph import Graph from taskgraph.task import Task