Skip to content

Commit ed0698f

Browse files
authored
Updates for pycodestyle. (#2973)
1 parent f822e44 commit ed0698f

File tree

18 files changed

+23
-23
lines changed

18 files changed

+23
-23
lines changed

bigquery/unit_tests/test_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def api_request(self, **kw):
838838

839839
try:
840840
response, self._responses = self._responses[0], self._responses[1:]
841-
except:
841+
except IndexError:
842842
raise NotFound('miss')
843843
else:
844844
return response

bigquery/unit_tests/test_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ def api_request(self, **kw):
19041904

19051905
try:
19061906
response, self._responses = self._responses[0], self._responses[1:]
1907-
except:
1907+
except IndexError:
19081908
raise NotFound('miss')
19091909
else:
19101910
return response

bigquery/unit_tests/test_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ def api_request(self, **kw):
19891989

19901990
try:
19911991
response, self._responses = self._responses[0], self._responses[1:]
1992-
except:
1992+
except IndexError:
19931993
raise NotFound('miss')
19941994
else:
19951995
return response

bigtable/unit_tests/test_instance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ def test_create(self):
254254
metadata=Any(
255255
type_url=type_url,
256256
value=metadata.SerializeToString(),
257-
)
258257
)
258+
)
259259

260260
# Patch the stub used by the API method.
261261
client._instance_stub = stub = _FakeStub(response_pb)

core/unit_tests/test_exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_ctor_explicit(self):
4040
'locationType': 'testing',
4141
'message': 'Testing',
4242
'reason': 'test',
43-
}
43+
}
4444
e = self._make_one('Testing', [ERROR])
4545
e.code = 600
4646
self.assertEqual(str(e), '600 Testing')
@@ -115,7 +115,7 @@ def test_miss_w_content_as_dict(self):
115115
'locationType': 'testing',
116116
'message': 'Testing',
117117
'reason': 'test',
118-
}
118+
}
119119
response = _Response(600)
120120
content = {"error": {"message": "Unknown Error", "errors": [ERROR]}}
121121
exception = self._call_fut(response, content)

datastore/google/cloud/datastore/transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def begin(self):
186186
try:
187187
self._id = self._client._connection.begin_transaction(
188188
self.project)
189-
except:
189+
except: # noqa: E722 do not use bare except, specify exception instead
190190
self._status = self._ABORTED
191191
raise
192192

datastore/unit_tests/test__http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,11 @@ def test_allocate_ids_non_empty(self):
10511051
before_key_pbs = [
10521052
self._make_key_pb(PROJECT, id_=None),
10531053
self._make_key_pb(PROJECT, id_=None),
1054-
]
1054+
]
10551055
after_key_pbs = [
10561056
self._make_key_pb(PROJECT),
10571057
self._make_key_pb(PROJECT, id_=2345),
1058-
]
1058+
]
10591059
rsp_pb = datastore_pb2.AllocateIdsResponse()
10601060
rsp_pb.keys.add().CopyFrom(after_key_pbs[0])
10611061
rsp_pb.keys.add().CopyFrom(after_key_pbs[1])

datastore/unit_tests/test_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_put_entity_w_completed_key(self):
121121
'baz': 'qux',
122122
'spam': [1, 2, 3],
123123
'frotz': [], # will be ignored
124-
}
124+
}
125125
connection = _Connection()
126126
client = _Client(_PROJECT, connection)
127127
batch = self._make_one(client)

datastore/unit_tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def test_query_explicit(self):
853853
projection=PROJECTION,
854854
order=ORDER,
855855
distinct_on=DISTINCT_ON,
856-
)
856+
)
857857

858858
self.assertIsInstance(query, _Dummy)
859859
self.assertEqual(query.args, (client,))

datastore/unit_tests/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_ctor_explicit(self):
6868
projection=PROJECTION,
6969
order=ORDER,
7070
distinct_on=DISTINCT_ON,
71-
)
71+
)
7272
self.assertIs(query._client, client)
7373
self.assertEqual(query.project, _PROJECT)
7474
self.assertEqual(query.kind, _KIND)

0 commit comments

Comments
 (0)