Skip to content

Commit 2095b09

Browse files
committed
fixed lint
1 parent 9c4e8db commit 2095b09

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

packages/google-cloud-bigquery/tests/system/test_ssl_retry.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import pytest
1919
import requests.exceptions
20-
from google.api_core import exceptions as core_exceptions
2120
from google.cloud import bigquery
2221

22+
2323
def test_insert_rows_json_ssl_error_no_retry(bigquery_client, dataset_id, project_id):
2424
"""
2525
Verify that SSLError during insert_rows_json is NOT retried and
@@ -32,25 +32,23 @@ def test_insert_rows_json_ssl_error_no_retry(bigquery_client, dataset_id, projec
3232
try:
3333
# We mock the api_request to simulate the GFE abruptly closing the connection
3434
# which manifests as a requests.exceptions.SSLError.
35-
original_api_request = bigquery_client._connection.api_request
35+
bigquery_client._connection.api_request
3636
call_count = 0
3737

3838
def mock_api_request(*args, **kwargs):
3939
nonlocal call_count
4040
call_count += 1
4141
raise requests.exceptions.SSLError("EOF occurred in violation of protocol")
4242

43-
with mock.patch.object(bigquery_client._connection, "api_request", side_effect=mock_api_request):
43+
with mock.patch.object(
44+
bigquery_client._connection, "api_request", side_effect=mock_api_request
45+
):
4446
# Use a reasonably short deadline for the test, although it should fail on the first attempt anyway.
4547
retry = bigquery.DEFAULT_RETRY.with_deadline(5.0)
4648

4749
start_time = time.time()
4850
with pytest.raises(requests.exceptions.SSLError) as excinfo:
49-
bigquery_client.insert_rows_json(
50-
table,
51-
[{"name": "test"}],
52-
retry=retry
53-
)
51+
bigquery_client.insert_rows_json(table, [{"name": "test"}], retry=retry)
5452
duration = time.time() - start_time
5553

5654
# Verification:

packages/google-cloud-bigquery/tests/unit/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6767,7 +6767,7 @@ def test_insert_rows_json_w_ssl_error(self):
67676767
creds = _make_credentials()
67686768
client = self._make_one(project=PROJECT, credentials=creds, _http=object())
67696769
conn = client._connection = make_connection({})
6770-
6770+
67716771
# Make the connection raise an SSLError
67726772
conn.api_request.side_effect = requests.exceptions.SSLError("EOF occurred")
67736773

0 commit comments

Comments
 (0)