Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer the newer mock from the Standard Library, when available #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/mbed-greentea/test/mbed_gt_cmake_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"""

import os
import mock
try:
from unittest import mock
except ImportError
import mock
import six
import sys
import unittest
Expand Down
5 changes: 4 additions & 1 deletion packages/mbed-host-tests/test/conn_primitive_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"""

import unittest
import mock
try:
from unittest import mock
except ImportError
import mock

from mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote import RemoteConnectorPrimitive

Expand Down
5 changes: 4 additions & 1 deletion packages/mbed-host-tests/test/mps2_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"""

import unittest
import mock
try:
from unittest import mock
except ImportError
import mock
import os
import time

Expand Down
5 changes: 4 additions & 1 deletion test/test/conn_primitive_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# limitations under the License.

import unittest
import mock
try:
from unittest import mock
except ImportError
import mock

from mbed_os_tools.test.host_tests_conn_proxy.conn_primitive_remote import RemoteConnectorPrimitive

Expand Down
5 changes: 4 additions & 1 deletion test/test/mbed_gt_cmake_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# limitations under the License.

import os
import mock
try:
from unittest import mock
except ImportError
import mock
import six
import sys
import unittest
Expand Down
5 changes: 4 additions & 1 deletion test/test/mbed_gt_greentea_dlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
import unittest

from lockfile import LockFile
from mock import patch
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from mbed_os_tools.test import mbed_greentea_dlm

home_dir = tempfile.mkdtemp()
Expand Down
5 changes: 4 additions & 1 deletion test/test/mbed_gt_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import sys
import unittest

from mock import patch
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from mbed_os_tools.test.mbed_greentea_hooks import GreenteaCliTestHook
from mbed_os_tools.test.mbed_greentea_hooks import LcovHook

Expand Down
5 changes: 4 additions & 1 deletion test/test/mbed_gt_report_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
import tempfile
import unittest

from mock import patch
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from mbed_os_tools.test import mbed_report_api

class GreenteaReportApiFunctionality(unittest.TestCase):
Expand Down
5 changes: 4 additions & 1 deletion test/test/mbed_gt_target_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

from six import StringIO

from mock import patch
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from mbed_os_tools.test import mbed_target_info


Expand Down
6 changes: 4 additions & 2 deletions test/test/mbed_gt_test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

import unittest
from mbed_os_tools.test import mbed_test_api
from mock import patch, MagicMock

try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock

class GreenteaTestAPI(unittest.TestCase):

Expand Down
5 changes: 4 additions & 1 deletion test/test/mocks/environment/linux.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
from builtins import super
from mock import MagicMock
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock

from .posix import MockTestEnvironmentPosix

Expand Down
5 changes: 4 additions & 1 deletion test/test/mps2_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# limitations under the License.

import unittest
import mock
try:
from unittest import mock
except ImportError
import mock
import os
import time

Expand Down
5 changes: 4 additions & 1 deletion test/test/test_conn_primitive_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# limitations under the License.

import unittest
import mock
try:
from unittest import mock
except ImportError
import mock

from mbed_os_tools.test.host_tests_conn_proxy.conn_primitive_serial import SerialConnectorPrimitive
from mbed_os_tools.test.host_tests_conn_proxy.conn_primitive import ConnectorPrimitiveException
Expand Down
5 changes: 4 additions & 1 deletion test/test/test_mbed_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import shutil
import mock
try:
from unittest import mock
except ImportError
import mock
import os
import unittest
from tempfile import mkdtemp
Expand Down
Loading