diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a9bdb1b7ac..dd98abbdee 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb -# created: 2023-10-02T21:31:03.517640371Z + digest: sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547 +# created: 2023-10-09T14:06:13.397766266Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 96d593c8c8..0332d3267e 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -467,9 +467,9 @@ typing-extensions==4.4.0 \ --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 +urllib3==1.26.17 \ + --hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \ + --hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b # via # requests # twine diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19409cbd37..6a8e169506 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py index 5aaedde91c..07fe33ae45 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py @@ -3183,7 +3183,6 @@ def __call__( timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Call the cancel operation method over HTTP. Args: @@ -3258,7 +3257,6 @@ def __call__( timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Call the delete operation method over HTTP. Args: @@ -3333,7 +3331,6 @@ def __call__( timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: - r"""Call the get operation method over HTTP. Args: @@ -3412,7 +3409,6 @@ def __call__( timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: - r"""Call the list operations method over HTTP. Args: diff --git a/google/cloud/spanner_v1/database.py b/google/cloud/spanner_v1/database.py index 1d211f7d6d..eee34361b3 100644 --- a/google/cloud/spanner_v1/database.py +++ b/google/cloud/spanner_v1/database.py @@ -648,7 +648,6 @@ def execute_partitioned_dml( def execute_pdml(): with SessionCheckout(self._pool) as session: - txn = api.begin_transaction( session=session.name, options=txn_options, metadata=metadata ) diff --git a/google/cloud/spanner_v1/session.py b/google/cloud/spanner_v1/session.py index 256e72511b..b25af53805 100644 --- a/google/cloud/spanner_v1/session.py +++ b/google/cloud/spanner_v1/session.py @@ -441,7 +441,6 @@ def _delay_until_retry(exc, deadline, attempts): delay = _get_retry_delay(cause, attempts) if delay is not None: - if now + delay > deadline: raise diff --git a/noxfile.py b/noxfile.py index 95fe0d2365..e1677c220b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,22 +17,24 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import re import shutil +from typing import Dict, List import warnings import nox FLAKE8_VERSION = "flake8==6.1.0" -BLACK_VERSION = "black==22.3.0" -ISORT_VERSION = "isort==5.10.1" +BLACK_VERSION = "black[jupyter]==23.7.0" +ISORT_VERSION = "isort==5.11.0" LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -40,25 +42,25 @@ "pytest-cov", "pytest-asyncio", ] -UNIT_TEST_EXTERNAL_DEPENDENCIES = [] -UNIT_TEST_LOCAL_DEPENDENCIES = [] -UNIT_TEST_DEPENDENCIES = [] -UNIT_TEST_EXTRAS = [] -UNIT_TEST_EXTRAS_BY_PYTHON = {} - -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] -SYSTEM_TEST_STANDARD_DEPENDENCIES = [ +UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] +UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] +UNIT_TEST_DEPENDENCIES: List[str] = [] +UNIT_TEST_EXTRAS: List[str] = [] +UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} + +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [ "mock", "pytest", "google-cloud-testutils", ] -SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] -SYSTEM_TEST_LOCAL_DEPENDENCIES = [] -SYSTEM_TEST_DEPENDENCIES = [] -SYSTEM_TEST_EXTRAS = [ +SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_EXTRAS: List[str] = [ "tracing", ] -SYSTEM_TEST_EXTRAS_BY_PYTHON = {} +SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -71,6 +73,7 @@ "lint_setup_py", "blacken", "docs", + "format", ] # Error if a python version is missing @@ -210,7 +213,6 @@ def unit(session): def install_systemtest_dependencies(session, *constraints): - # Use pre-release gRPC for system tests. # Exclude version 1.52.0rc1 which has a known issue. # See https://github.com/grpc/grpc/issues/32163 diff --git a/tests/system/_sample_data.py b/tests/system/_sample_data.py index a7f3b80a86..2398442aff 100644 --- a/tests/system/_sample_data.py +++ b/tests/system/_sample_data.py @@ -70,7 +70,6 @@ def _check_row_data(row_data, expected, recurse_into_lists=True): def _check_cell_data(found_cell, expected_cell, recurse_into_lists=True): - if isinstance(found_cell, datetime_helpers.DatetimeWithNanoseconds): _assert_timestamp(expected_cell, found_cell) diff --git a/tests/system/conftest.py b/tests/system/conftest.py index fdeab14c8f..b297d1f2ad 100644 --- a/tests/system/conftest.py +++ b/tests/system/conftest.py @@ -119,7 +119,6 @@ def instance_configs(spanner_client): configs = list(_helpers.retry_503(spanner_client.list_instance_configs)()) if not _helpers.USE_EMULATOR: - # Defend against back-end returning configs for regions we aren't # actually allowed to use. configs = [config for config in configs if "-us-" in config.name] diff --git a/tests/system/test_dbapi.py b/tests/system/test_dbapi.py index cb5a11e89d..29617ad614 100644 --- a/tests/system/test_dbapi.py +++ b/tests/system/test_dbapi.py @@ -64,7 +64,6 @@ def clear_table(transaction): @pytest.fixture(scope="function") def dbapi_database(raw_database): - raw_database.run_in_transaction(clear_table) yield raw_database diff --git a/tests/system/test_session_api.py b/tests/system/test_session_api.py index 7d58324b04..c4ea2ded40 100644 --- a/tests/system/test_session_api.py +++ b/tests/system/test_session_api.py @@ -306,7 +306,6 @@ def assert_span_attributes( def _make_attributes(db_instance, **kwargs): - attributes = { "db.type": "spanner", "db.url": "spanner.googleapis.com", @@ -1099,7 +1098,6 @@ def test_transaction_batch_update_w_parent_span( ) def unit_of_work(transaction): - status, row_counts = transaction.batch_update( [insert_statement, update_statement, delete_statement] ) @@ -1303,7 +1301,6 @@ def _row_data(max_index): def _set_up_table(database, row_count): - sd = _sample_data def _unit_of_work(transaction): @@ -1430,7 +1427,6 @@ def test_multiuse_snapshot_read_isolation_read_timestamp(sessions_database): with sessions_database.snapshot( read_timestamp=committed, multi_use=True ) as read_ts: - before = list(read_ts.read(sd.TABLE, sd.COLUMNS, sd.ALL)) sd._check_row_data(before, all_data_rows) @@ -1452,7 +1448,6 @@ def test_multiuse_snapshot_read_isolation_exact_staleness(sessions_database): delta = datetime.timedelta(microseconds=1000) with sessions_database.snapshot(exact_staleness=delta, multi_use=True) as exact: - before = list(exact.read(sd.TABLE, sd.COLUMNS, sd.ALL)) sd._check_row_data(before, all_data_rows) @@ -1945,7 +1940,6 @@ def test_multiuse_snapshot_execute_sql_isolation_strong(sessions_database): all_data_rows = list(_row_data(row_count)) with sessions_database.snapshot(multi_use=True) as strong: - before = list(strong.execute_sql(sd.SQL)) sd._check_row_data(before, all_data_rows) @@ -2005,7 +1999,6 @@ def test_invalid_type(sessions_database): def test_execute_sql_select_1(sessions_database): - sessions_database.snapshot(multi_use=True) # Hello, world query @@ -2175,7 +2168,6 @@ def test_execute_sql_w_bytes_bindings(sessions_database, database_dialect): def test_execute_sql_w_timestamp_bindings(sessions_database, database_dialect): - timestamp_1 = datetime_helpers.DatetimeWithNanoseconds( 1989, 1, 17, 17, 59, 12, nanosecond=345612789 ) @@ -2462,7 +2454,6 @@ def test_execute_sql_w_query_param_struct(sessions_database, not_postgres): def test_execute_sql_returning_transfinite_floats(sessions_database, not_postgres): - with sessions_database.snapshot(multi_use=True) as snapshot: # Query returning -inf, +inf, NaN as column values rows = list( @@ -2537,7 +2528,6 @@ def details(self): def _check_batch_status(status_code, expected=code_pb2.OK): if status_code != expected: - _status_code_to_grpc_status_code = { member.value[0]: member for member in grpc.StatusCode } diff --git a/tests/unit/spanner_dbapi/test_cursor.py b/tests/unit/spanner_dbapi/test_cursor.py index f744fc769f..46a093b109 100644 --- a/tests/unit/spanner_dbapi/test_cursor.py +++ b/tests/unit/spanner_dbapi/test_cursor.py @@ -20,7 +20,6 @@ class TestCursor(unittest.TestCase): - INSTANCE = "test-instance" DATABASE = "test-database" @@ -917,7 +916,6 @@ def test_fetchone_retry_aborted(self, mock_client): with mock.patch( "google.cloud.spanner_dbapi.connection.Connection.retry_transaction" ) as retry_mock: - cursor.fetchone() retry_mock.assert_called_with() @@ -948,7 +946,6 @@ def test_fetchone_retry_aborted_statements(self, mock_client): "google.cloud.spanner_dbapi.connection.Connection.run_statement", return_value=([row], ResultsChecksum()), ) as run_mock: - cursor.fetchone() run_mock.assert_called_with(statement, retried=True) @@ -982,7 +979,6 @@ def test_fetchone_retry_aborted_statements_checksums_mismatch(self, mock_client) "google.cloud.spanner_dbapi.connection.Connection.run_statement", return_value=([row2], ResultsChecksum()), ) as run_mock: - with self.assertRaises(RetryAborted): cursor.fetchone() @@ -1007,7 +1003,6 @@ def test_fetchall_retry_aborted(self, mock_client): with mock.patch( "google.cloud.spanner_dbapi.connection.Connection.retry_transaction" ) as retry_mock: - cursor.fetchall() retry_mock.assert_called_with() @@ -1071,7 +1066,6 @@ def test_fetchall_retry_aborted_statements_checksums_mismatch(self, mock_client) "google.cloud.spanner_dbapi.connection.Connection.run_statement", return_value=([row2], ResultsChecksum()), ) as run_mock: - with self.assertRaises(RetryAborted): cursor.fetchall() @@ -1096,7 +1090,6 @@ def test_fetchmany_retry_aborted(self, mock_client): with mock.patch( "google.cloud.spanner_dbapi.connection.Connection.retry_transaction" ) as retry_mock: - cursor.fetchmany() retry_mock.assert_called_with() @@ -1127,7 +1120,6 @@ def test_fetchmany_retry_aborted_statements(self, mock_client): "google.cloud.spanner_dbapi.connection.Connection.run_statement", return_value=([row], ResultsChecksum()), ) as run_mock: - cursor.fetchmany(len(row)) run_mock.assert_called_with(statement, retried=True) @@ -1161,7 +1153,6 @@ def test_fetchmany_retry_aborted_statements_checksums_mismatch(self, mock_client "google.cloud.spanner_dbapi.connection.Connection.run_statement", return_value=([row2], ResultsChecksum()), ) as run_mock: - with self.assertRaises(RetryAborted): cursor.fetchmany(len(row)) diff --git a/tests/unit/spanner_dbapi/test_parse_utils.py b/tests/unit/spanner_dbapi/test_parse_utils.py index ddd1d5572a..887f984c2c 100644 --- a/tests/unit/spanner_dbapi/test_parse_utils.py +++ b/tests/unit/spanner_dbapi/test_parse_utils.py @@ -20,7 +20,6 @@ class TestParseUtils(unittest.TestCase): - skip_condition = sys.version_info[0] < 3 skip_message = "Subtests are not supported in Python 2" @@ -112,7 +111,7 @@ def test_sql_pyformat_args_to_spanner(self): ("SELECT * from t WHERE id=10", {"f1": "app", "f2": "name"}), ), ] - for ((sql_in, params), sql_want) in cases: + for (sql_in, params), sql_want in cases: with self.subTest(sql=sql_in): got_sql, got_named_args = sql_pyformat_args_to_spanner(sql_in, params) want_sql, want_named_args = sql_want diff --git a/tests/unit/spanner_dbapi/test_parser.py b/tests/unit/spanner_dbapi/test_parser.py index dd99f6fa4b..25f51591c2 100644 --- a/tests/unit/spanner_dbapi/test_parser.py +++ b/tests/unit/spanner_dbapi/test_parser.py @@ -17,7 +17,6 @@ class TestParser(unittest.TestCase): - skip_condition = sys.version_info[0] < 3 skip_message = "Subtests are not supported in Python 2" diff --git a/tests/unit/spanner_dbapi/test_types.py b/tests/unit/spanner_dbapi/test_types.py index 8c9dbe6c2b..375dc31853 100644 --- a/tests/unit/spanner_dbapi/test_types.py +++ b/tests/unit/spanner_dbapi/test_types.py @@ -18,7 +18,6 @@ class TestTypes(unittest.TestCase): - TICKS = 1572822862.9782631 + timezone # Sun 03 Nov 2019 23:14:22 UTC def test__date_from_ticks(self): diff --git a/tests/unit/spanner_dbapi/test_utils.py b/tests/unit/spanner_dbapi/test_utils.py index 76c347d402..fadbca1a09 100644 --- a/tests/unit/spanner_dbapi/test_utils.py +++ b/tests/unit/spanner_dbapi/test_utils.py @@ -17,7 +17,6 @@ class TestUtils(unittest.TestCase): - skip_condition = sys.version_info[0] < 3 skip_message = "Subtests are not supported in Python 2" diff --git a/tests/unit/test_batch.py b/tests/unit/test_batch.py index 0199d44033..856816628f 100644 --- a/tests/unit/test_batch.py +++ b/tests/unit/test_batch.py @@ -32,7 +32,6 @@ class _BaseTest(unittest.TestCase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID @@ -426,7 +425,6 @@ class _Database(object): class _FauxSpannerAPI: - _create_instance_conflict = False _instance_not_found = False _committed = None diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index ed79271a96..049ee1124f 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -29,7 +29,6 @@ class _CredentialsWithScopes( class TestClient(unittest.TestCase): - PROJECT = "PROJECT" PATH = "projects/%s" % (PROJECT,) CONFIGURATION_NAME = "config-name" diff --git a/tests/unit/test_database.py b/tests/unit/test_database.py index 5a6abf8084..bd368eed11 100644 --- a/tests/unit/test_database.py +++ b/tests/unit/test_database.py @@ -49,7 +49,6 @@ class _CredentialsWithScopes( class _BaseTest(unittest.TestCase): - PROJECT_ID = "project-id" PARENT = "projects/" + PROJECT_ID INSTANCE_ID = "instance-id" @@ -148,14 +147,12 @@ def test_ctor_w_route_to_leader_disbled(self): self.assertFalse(database._route_to_leader_enabled) def test_ctor_w_ddl_statements_non_string(self): - with self.assertRaises(ValueError): self._make_one( self.DATABASE_ID, instance=object(), ddl_statements=[object()] ) def test_ctor_w_ddl_statements_w_create_database(self): - with self.assertRaises(ValueError): self._make_one( self.DATABASE_ID, @@ -365,7 +362,6 @@ def test_default_leader(self): self.assertEqual(database.default_leader, default_leader) def test_spanner_api_property_w_scopeless_creds(self): - client = _Client() client_info = client._client_info = mock.Mock() client_options = client._client_options = mock.Mock() @@ -2744,7 +2740,6 @@ def put(self, session): class _Session(object): - _rows = () _created = False _transaction = None diff --git a/tests/unit/test_instance.py b/tests/unit/test_instance.py index 0a7dbccb81..20064e7e88 100644 --- a/tests/unit/test_instance.py +++ b/tests/unit/test_instance.py @@ -17,7 +17,6 @@ class TestInstance(unittest.TestCase): - PROJECT = "project" PARENT = "projects/" + PROJECT INSTANCE_ID = "instance-id" @@ -1031,7 +1030,6 @@ def __eq__(self, other): class _FauxInstanceAdminAPI(object): - _create_instance_conflict = False _instance_not_found = False _rpc_error = False diff --git a/tests/unit/test_keyset.py b/tests/unit/test_keyset.py index a7bad4070d..8fc743e075 100644 --- a/tests/unit/test_keyset.py +++ b/tests/unit/test_keyset.py @@ -205,7 +205,6 @@ def test_ctor_w_ranges(self): self.assertEqual(keyset.ranges, [range_1, range_2]) def test_ctor_w_all_and_keys(self): - with self.assertRaises(ValueError): self._make_one(all_=True, keys=[["key1"], ["key2"]]) diff --git a/tests/unit/test_pool.py b/tests/unit/test_pool.py index 58665634de..23ed3e7251 100644 --- a/tests/unit/test_pool.py +++ b/tests/unit/test_pool.py @@ -913,7 +913,6 @@ def _make_transaction(*args, **kw): @total_ordering class _Session(object): - _transaction = None def __init__(self, database, exists=True, transaction=None): @@ -1004,7 +1003,6 @@ def session(self, **kwargs): class _Queue(object): - _size = 1 def __init__(self, *items): @@ -1035,5 +1033,4 @@ def put_nowait(self, item, **kwargs): class _Pool(_Queue): - _database = None diff --git a/tests/unit/test_session.py b/tests/unit/test_session.py index 3125e33f21..0bb02ebdc7 100644 --- a/tests/unit/test_session.py +++ b/tests/unit/test_session.py @@ -37,7 +37,6 @@ def time(self): class TestSession(OpenTelemetryBase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID diff --git a/tests/unit/test_snapshot.py b/tests/unit/test_snapshot.py index 5d2afb4fe6..0010877396 100644 --- a/tests/unit/test_snapshot.py +++ b/tests/unit/test_snapshot.py @@ -56,7 +56,6 @@ def _getTargetClass(self): def _makeDerived(self, session): class _Derived(self._getTargetClass()): - _transaction_id = None _multi_use = False @@ -514,7 +513,6 @@ def test_iteration_w_multiple_span_creation(self): class Test_SnapshotBase(OpenTelemetryBase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID @@ -533,7 +531,6 @@ def _make_one(self, session): def _makeDerived(self, session): class _Derived(self._getTargetClass()): - _transaction_id = None _multi_use = False @@ -1358,7 +1355,6 @@ def test_partition_query_ok_w_timeout_and_retry_params(self): class TestSnapshot(OpenTelemetryBase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID diff --git a/tests/unit/test_spanner.py b/tests/unit/test_spanner.py index e4cd1e84cd..8c04e1142d 100644 --- a/tests/unit/test_spanner.py +++ b/tests/unit/test_spanner.py @@ -88,7 +88,6 @@ class TestTransaction(OpenTelemetryBase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID @@ -344,7 +343,6 @@ def _read_helper( self.assertEqual(result_set.stats, stats_pb) def _read_helper_expected_request(self, partition=None, begin=True, count=0): - if begin is True: expected_transaction = TransactionSelector( begin=TransactionOptions(read_write=TransactionOptions.ReadWrite()) @@ -939,7 +937,6 @@ def __init__(self): class _Session(object): - _transaction = None def __init__(self, database=None, name=TestTransaction.SESSION_NAME): diff --git a/tests/unit/test_streamed.py b/tests/unit/test_streamed.py index 2714ddfb45..85dcb40026 100644 --- a/tests/unit/test_streamed.py +++ b/tests/unit/test_streamed.py @@ -973,7 +973,6 @@ def test___iter___w_existing_rows_read(self): class _MockCancellableIterator(object): - cancel_calls = 0 def __init__(self, *values): @@ -987,7 +986,6 @@ def __next__(self): # pragma: NO COVER Py3k class TestStreamedResultSet_JSON_acceptance_tests(unittest.TestCase): - _json_tests = None def _getTargetClass(self): @@ -1006,7 +1004,7 @@ def _load_json_test(self, test_name): filename = os.path.join(dirname, "streaming-read-acceptance-test.json") raw = _parse_streaming_read_acceptance_tests(filename) tests = self.__class__._json_tests = {} - for (name, partial_result_sets, results) in raw: + for name, partial_result_sets, results in raw: tests[name] = partial_result_sets, results return self.__class__._json_tests[test_name] diff --git a/tests/unit/test_transaction.py b/tests/unit/test_transaction.py index 85359dac19..ffcffa115e 100644 --- a/tests/unit/test_transaction.py +++ b/tests/unit/test_transaction.py @@ -42,7 +42,6 @@ class TestTransaction(OpenTelemetryBase): - PROJECT_ID = "project-id" INSTANCE_ID = "instance-id" INSTANCE_NAME = "projects/" + PROJECT_ID + "/instances/" + INSTANCE_ID @@ -910,7 +909,6 @@ def __init__(self): class _Session(object): - _transaction = None def __init__(self, database=None, name=TestTransaction.SESSION_NAME): @@ -919,7 +917,6 @@ def __init__(self, database=None, name=TestTransaction.SESSION_NAME): class _FauxSpannerAPI(object): - _committed = None def __init__(self, **kwargs):