Skip to content

Commit

Permalink
Updates for pycodestyle. (googleapis#2973)
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster authored Jan 31, 2017
1 parent eda8aac commit 71590da
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bigquery/unit_tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
2 changes: 1 addition & 1 deletion bigquery/unit_tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
2 changes: 1 addition & 1 deletion bigquery/unit_tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
Expand Down
2 changes: 1 addition & 1 deletion bigtable/unit_tests/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def test_create(self):
metadata=Any(
type_url=type_url,
value=metadata.SerializeToString(),
)
)
)

# Patch the stub used by the API method.
client._instance_stub = stub = _FakeStub(response_pb)
Expand Down
4 changes: 2 additions & 2 deletions core/unit_tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_ctor_explicit(self):
'locationType': 'testing',
'message': 'Testing',
'reason': 'test',
}
}
e = self._make_one('Testing', [ERROR])
e.code = 600
self.assertEqual(str(e), '600 Testing')
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_miss_w_content_as_dict(self):
'locationType': 'testing',
'message': 'Testing',
'reason': 'test',
}
}
response = _Response(600)
content = {"error": {"message": "Unknown Error", "errors": [ERROR]}}
exception = self._call_fut(response, content)
Expand Down
2 changes: 1 addition & 1 deletion datastore/google/cloud/datastore/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def begin(self):
try:
self._id = self._client._connection.begin_transaction(
self.project)
except:
except: # noqa: E722 do not use bare except, specify exception instead
self._status = self._ABORTED
raise

Expand Down
4 changes: 2 additions & 2 deletions datastore/unit_tests/test__http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@ def test_allocate_ids_non_empty(self):
before_key_pbs = [
self._make_key_pb(PROJECT, id_=None),
self._make_key_pb(PROJECT, id_=None),
]
]
after_key_pbs = [
self._make_key_pb(PROJECT),
self._make_key_pb(PROJECT, id_=2345),
]
]
rsp_pb = datastore_pb2.AllocateIdsResponse()
rsp_pb.keys.add().CopyFrom(after_key_pbs[0])
rsp_pb.keys.add().CopyFrom(after_key_pbs[1])
Expand Down
2 changes: 1 addition & 1 deletion datastore/unit_tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_put_entity_w_completed_key(self):
'baz': 'qux',
'spam': [1, 2, 3],
'frotz': [], # will be ignored
}
}
connection = _Connection()
client = _Client(_PROJECT, connection)
batch = self._make_one(client)
Expand Down
2 changes: 1 addition & 1 deletion datastore/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ def test_query_explicit(self):
projection=PROJECTION,
order=ORDER,
distinct_on=DISTINCT_ON,
)
)

self.assertIsInstance(query, _Dummy)
self.assertEqual(query.args, (client,))
Expand Down
2 changes: 1 addition & 1 deletion datastore/unit_tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_ctor_explicit(self):
projection=PROJECTION,
order=ORDER,
distinct_on=DISTINCT_ON,
)
)
self.assertIs(query._client, client)
self.assertEqual(query.project, _PROJECT)
self.assertEqual(query.kind, _KIND)
Expand Down
4 changes: 2 additions & 2 deletions dns/google/cloud/dns/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ def _build_resource(self):
'type': added.record_type,
'ttl': str(added.ttl),
'rrdatas': added.rrdatas,
} for added in self.additions]
} for added in self.additions]

deletions = [{
'name': deleted.name,
'type': deleted.record_type,
'ttl': str(deleted.ttl),
'rrdatas': deleted.rrdatas,
} for deleted in self.deletions]
} for deleted in self.deletions]

return {
'additions': additions,
Expand Down
2 changes: 1 addition & 1 deletion dns/unit_tests/test_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
2 changes: 1 addition & 1 deletion dns/unit_tests/test_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
2 changes: 1 addition & 1 deletion resource_manager/unit_tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
Expand Down
2 changes: 1 addition & 1 deletion runtimeconfig/unit_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
2 changes: 1 addition & 1 deletion runtimeconfig/unit_tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
6 changes: 3 additions & 3 deletions storage/unit_tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_ctor_body_None(self):
LINES = [
"DELETE /path/to/api HTTP/1.1",
"",
]
]
mah = self._make_one(METHOD, PATH, {}, None)
self.assertEqual(mah.get_content_type(), 'application/http')
self.assertEqual(mah.get_payload().splitlines(), LINES)
Expand All @@ -56,7 +56,7 @@ def test_ctor_body_str(self):
"Content-Type: text/plain",
"",
"ABC",
]
]
mah = self._make_one(METHOD, PATH, HEADERS, BODY)
self.assertEqual(mah.get_payload().splitlines(), LINES)

Expand All @@ -71,7 +71,7 @@ def test_ctor_body_dict(self):
'Content-Type: application/json',
'',
'{"foo": "bar"}',
]
]
mah = self._make_one(METHOD, PATH, HEADERS, BODY)
self.assertEqual(mah.get_payload().splitlines(), LINES)

Expand Down
2 changes: 1 addition & 1 deletion storage/unit_tests/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ def api_request(self, **kw):

try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except IndexError:
raise NotFound('miss')
else:
return response
Expand Down

0 comments on commit 71590da

Please sign in to comment.