|
|
0552c28 |
From 89c9cf11f1595e44b7b6355107bb4d643583ac54 Mon Sep 17 00:00:00 2001
|
|
|
0552c28 |
From: Major Hayden <major@redhat.com>
|
|
|
0552c28 |
Date: Fri, 3 Dec 2021 07:54:30 -0600
|
|
|
3658c53 |
Subject: [PATCH] Use unittest.mock
|
|
|
3658c53 |
|
|
|
0552c28 |
Signed-off-by: Major Hayden <major@redhat.com>
|
|
|
3658c53 |
---
|
|
|
3658c53 |
tests/_helpers.py | 2 +-
|
|
|
3658c53 |
.../unit/gapic/spanner_admin_database_v1/test_database_admin.py | 2 +-
|
|
|
3658c53 |
.../unit/gapic/spanner_admin_instance_v1/test_instance_admin.py | 2 +-
|
|
|
3658c53 |
tests/unit/gapic/spanner_v1/test_spanner.py | 2 +-
|
|
|
3658c53 |
tests/unit/spanner_dbapi/test__helpers.py | 2 +-
|
|
|
3658c53 |
tests/unit/spanner_dbapi/test_connection.py | 2 +-
|
|
|
3658c53 |
tests/unit/spanner_dbapi/test_cursor.py | 2 +-
|
|
|
3658c53 |
tests/unit/test__opentelemetry_tracing.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_backup.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_client.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_database.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_instance.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_pool.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_session.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_snapshot.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_streamed.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_table.py | 2 +-
|
|
|
3658c53 |
tests/unit/test_transaction.py | 2 +-
|
|
|
0552c28 |
18 files changed, 18 insertions(+), 18 deletions(-)
|
|
|
3658c53 |
|
|
|
3658c53 |
diff --git a/tests/_helpers.py b/tests/_helpers.py
|
|
|
3658c53 |
index 42178fd..ec27cbb 100644
|
|
|
3658c53 |
--- a/tests/_helpers.py
|
|
|
3658c53 |
+++ b/tests/_helpers.py
|
|
|
3658c53 |
@@ -1,5 +1,5 @@
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
try:
|
|
|
3658c53 |
from opentelemetry import trace
|
|
|
3658c53 |
diff --git a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py
|
|
|
0552c28 |
index 4af539d..2e9a480 100644
|
|
|
3658c53 |
--- a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py
|
|
|
3658c53 |
+++ b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
# limitations under the License.
|
|
|
3658c53 |
#
|
|
|
3658c53 |
import os
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
import grpc
|
|
|
0552c28 |
from grpc.experimental import aio
|
|
|
3658c53 |
diff --git a/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py b/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py
|
|
|
0552c28 |
index 247619d..39b0da9 100644
|
|
|
3658c53 |
--- a/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py
|
|
|
3658c53 |
+++ b/tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
# limitations under the License.
|
|
|
3658c53 |
#
|
|
|
3658c53 |
import os
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
import grpc
|
|
|
0552c28 |
from grpc.experimental import aio
|
|
|
3658c53 |
diff --git a/tests/unit/gapic/spanner_v1/test_spanner.py b/tests/unit/gapic/spanner_v1/test_spanner.py
|
|
|
0552c28 |
index 3678053..1d73891 100644
|
|
|
3658c53 |
--- a/tests/unit/gapic/spanner_v1/test_spanner.py
|
|
|
3658c53 |
+++ b/tests/unit/gapic/spanner_v1/test_spanner.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
# limitations under the License.
|
|
|
3658c53 |
#
|
|
|
3658c53 |
import os
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
import grpc
|
|
|
0552c28 |
from grpc.experimental import aio
|
|
|
3658c53 |
diff --git a/tests/unit/spanner_dbapi/test__helpers.py b/tests/unit/spanner_dbapi/test__helpers.py
|
|
|
3658c53 |
index 84d6b3e..1d23dae 100644
|
|
|
3658c53 |
--- a/tests/unit/spanner_dbapi/test__helpers.py
|
|
|
3658c53 |
+++ b/tests/unit/spanner_dbapi/test__helpers.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
"""Cloud Spanner DB-API Connection class unit tests."""
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
diff --git a/tests/unit/spanner_dbapi/test_connection.py b/tests/unit/spanner_dbapi/test_connection.py
|
|
|
0552c28 |
index 0eea3ea..586ee73 100644
|
|
|
3658c53 |
--- a/tests/unit/spanner_dbapi/test_connection.py
|
|
|
3658c53 |
+++ b/tests/unit/spanner_dbapi/test_connection.py
|
|
|
0552c28 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
"""Cloud Spanner DB-API Connection class unit tests."""
|
|
|
3658c53 |
|
|
|
0552c28 |
import datetime
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
import warnings
|
|
|
3658c53 |
|
|
|
3658c53 |
diff --git a/tests/unit/spanner_dbapi/test_cursor.py b/tests/unit/spanner_dbapi/test_cursor.py
|
|
|
0552c28 |
index 90d07eb..0534e5c 100644
|
|
|
3658c53 |
--- a/tests/unit/spanner_dbapi/test_cursor.py
|
|
|
3658c53 |
+++ b/tests/unit/spanner_dbapi/test_cursor.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
"""Cursor() class unit tests."""
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
import sys
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
diff --git a/tests/unit/test__opentelemetry_tracing.py b/tests/unit/test__opentelemetry_tracing.py
|
|
|
3658c53 |
index 2587022..1d2dda3 100644
|
|
|
3658c53 |
--- a/tests/unit/test__opentelemetry_tracing.py
|
|
|
3658c53 |
+++ b/tests/unit/test__opentelemetry_tracing.py
|
|
|
3658c53 |
@@ -1,5 +1,5 @@
|
|
|
3658c53 |
import importlib
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
import sys
|
|
|
3658c53 |
|
|
|
3658c53 |
diff --git a/tests/unit/test_backup.py b/tests/unit/test_backup.py
|
|
|
3658c53 |
index 035a2c9..fa91033 100644
|
|
|
3658c53 |
--- a/tests/unit/test_backup.py
|
|
|
3658c53 |
+++ b/tests/unit/test_backup.py
|
|
|
3658c53 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
class _BaseTest(unittest.TestCase):
|
|
|
3658c53 |
diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py
|
|
|
3658c53 |
index 68d8ea6..e778136 100644
|
|
|
3658c53 |
--- a/tests/unit/test_client.py
|
|
|
3658c53 |
+++ b/tests/unit/test_client.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
def _make_credentials():
|
|
|
3658c53 |
diff --git a/tests/unit/test_database.py b/tests/unit/test_database.py
|
|
|
3658c53 |
index df5554d..5f79ce9 100644
|
|
|
3658c53 |
--- a/tests/unit/test_database.py
|
|
|
3658c53 |
+++ b/tests/unit/test_database.py
|
|
|
3658c53 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
from google.api_core import gapic_v1
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.cloud.spanner_v1.param_types import INT64
|
|
|
3658c53 |
diff --git a/tests/unit/test_instance.py b/tests/unit/test_instance.py
|
|
|
3658c53 |
index c715fb2..392707a 100644
|
|
|
3658c53 |
--- a/tests/unit/test_instance.py
|
|
|
3658c53 |
+++ b/tests/unit/test_instance.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
class TestInstance(unittest.TestCase):
|
|
|
3658c53 |
diff --git a/tests/unit/test_pool.py b/tests/unit/test_pool.py
|
|
|
0552c28 |
index 5934201..bf0bd59 100644
|
|
|
3658c53 |
--- a/tests/unit/test_pool.py
|
|
|
3658c53 |
+++ b/tests/unit/test_pool.py
|
|
|
3658c53 |
@@ -16,7 +16,7 @@
|
|
|
3658c53 |
from functools import total_ordering
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
def _make_database(name="name"):
|
|
|
3658c53 |
diff --git a/tests/unit/test_session.py b/tests/unit/test_session.py
|
|
|
3658c53 |
index fe78567..a062082 100644
|
|
|
3658c53 |
--- a/tests/unit/test_session.py
|
|
|
3658c53 |
+++ b/tests/unit/test_session.py
|
|
|
3658c53 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import google.api_core.gapic_v1.method
|
|
|
3658c53 |
from google.cloud.spanner_v1 import RequestOptions
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
from tests._helpers import (
|
|
|
3658c53 |
OpenTelemetryBase,
|
|
|
3658c53 |
StatusCode,
|
|
|
3658c53 |
diff --git a/tests/unit/test_snapshot.py b/tests/unit/test_snapshot.py
|
|
|
3658c53 |
index ef162fd..e3364de 100644
|
|
|
3658c53 |
--- a/tests/unit/test_snapshot.py
|
|
|
3658c53 |
+++ b/tests/unit/test_snapshot.py
|
|
|
3658c53 |
@@ -14,7 +14,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.api_core import gapic_v1
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.cloud.spanner_v1 import RequestOptions
|
|
|
3658c53 |
from tests._helpers import (
|
|
|
3658c53 |
diff --git a/tests/unit/test_streamed.py b/tests/unit/test_streamed.py
|
|
|
3658c53 |
index de0c887..f2b5adf 100644
|
|
|
3658c53 |
--- a/tests/unit/test_streamed.py
|
|
|
3658c53 |
+++ b/tests/unit/test_streamed.py
|
|
|
3658c53 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
class TestStreamedResultSet(unittest.TestCase):
|
|
|
3658c53 |
diff --git a/tests/unit/test_table.py b/tests/unit/test_table.py
|
|
|
3658c53 |
index 0a49a9b..245fa06 100644
|
|
|
3658c53 |
--- a/tests/unit/test_table.py
|
|
|
3658c53 |
+++ b/tests/unit/test_table.py
|
|
|
3658c53 |
@@ -15,7 +15,7 @@
|
|
|
3658c53 |
import unittest
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.cloud.exceptions import NotFound
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.cloud.spanner_v1.types import (
|
|
|
3658c53 |
StructType,
|
|
|
3658c53 |
diff --git a/tests/unit/test_transaction.py b/tests/unit/test_transaction.py
|
|
|
3658c53 |
index d11a349..0212294 100644
|
|
|
3658c53 |
--- a/tests/unit/test_transaction.py
|
|
|
3658c53 |
+++ b/tests/unit/test_transaction.py
|
|
|
3658c53 |
@@ -13,7 +13,7 @@
|
|
|
3658c53 |
# limitations under the License.
|
|
|
3658c53 |
|
|
|
3658c53 |
|
|
|
3658c53 |
-import mock
|
|
|
3658c53 |
+from unittest import mock
|
|
|
3658c53 |
|
|
|
3658c53 |
from google.cloud.spanner_v1 import RequestOptions
|
|
|
3658c53 |
from google.cloud.spanner_v1 import Type
|
|
|
3658c53 |
--
|
|
|
0552c28 |
2.33.1
|
|
|
3658c53 |
|