Skip to content

Commit

Permalink
Updates for pycodestyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Jan 30, 2017
1 parent 3584917 commit 6ec3865
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 10 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 Exception:
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 Exception:
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 Exception:
raise NotFound('miss')
else:
return response
Expand Down
2 changes: 2 additions & 0 deletions core/unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ def _call_fut(self, project=None):
return _determine_default_project(project=project)

def test_it(self):

with mock.patch('google.auth.default', autospec=True) as default:
default.return_value = (
mock.sentinel.credentials, mock.sentinel.project)
project = self._call_fut()

self.assertEqual(project, mock.sentinel.project)

default.assert_called_once_with()

def test_explicit(self):
Expand Down
1 change: 1 addition & 0 deletions core/unit_tests/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_it(self):
found = self._call_fut()

self.assertIs(found, mock.sentinel.credentials)

default.assert_called_once_with()


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 Exception:
self._status = self._ABORTED
raise

Expand Down
2 changes: 2 additions & 0 deletions datastore/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def test_ctor_w_project_no_environ(self):
def test_ctor_w_implicit_inputs(self):
OTHER = 'other'
creds = _make_credentials()

default_called = []

def fallback_mock(project):
Expand Down Expand Up @@ -515,6 +516,7 @@ def test_get_multi_max_loops(self):
client._connection._add_lookup_result([entity_pb])

key = Key(KIND, ID, project=self.PROJECT)

deferred = []
missing = []

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 Exception:
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 Exception:
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 Exception:
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 Exception:
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 Exception:
raise NotFound('miss')
else:
return response
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 Exception:
raise NotFound('miss')
else:
return response
Expand Down
1 change: 1 addition & 0 deletions vision/google/cloud/vision/safe_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def from_pb(cls, image):
:returns: Instance of ``SafeSearchAnnotation``.
"""
values = [image.adult, image.spoof, image.medical, image.violence]

classifications = map(_get_pb_likelihood, values)
return cls(*classifications)

Expand Down

0 comments on commit 6ec3865

Please sign in to comment.