pylint: 4 more

Change-Id: I4cc928d8212a5192927a994b4248f32fe05ca723
This commit is contained in:
Sorin Sbarnea 2020-09-10 16:05:55 +01:00
parent 360c57118c
commit 9d37c88c8f
5 changed files with 10 additions and 11 deletions

View File

@ -6,19 +6,15 @@ jobs = 0
disable =
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
broad-except,
dangerous-default-value,
duplicate-code,
fixme,
function-redefined,
global-statement,
inconsistent-return-statements,
invalid-name,
line-too-long,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
no-member,
no-self-use,
protected-access,
redefined-outer-name,
super-init-not-called,

View File

@ -141,6 +141,7 @@ def main():
if not cleaned:
cleaned.append('None')
info('%sRemoved queries:\n%s' % (prefix, '\n'.join(sorted(cleaned))))
return 0
if __name__ == "__main__":

View File

@ -105,7 +105,6 @@ class FailEvent(object):
rev = None
project = None
url = None
build_short_uuids = []
comment = None
failed_jobs = []

View File

@ -117,10 +117,10 @@ class ResultSet(list):
(pyes goes way overboard with nesting, which is fine in the general
case, but in the elastic_recheck case is just added complexity).
"""
def __init__(self, results={}):
self._results = results
if 'hits' in results:
self._parse_hits(results['hits'])
def __init__(self, results=None):
self._results = results or {}
if 'hits' in self._results:
self._parse_hits(self._results['hits'])
def _parse_hits(self, hits):
# why, oh why elastic search
@ -139,6 +139,7 @@ class ResultSet(list):
return self._results['facets']['tag'][attr]
if attr in self._results:
return self._results[attr]
raise AttributeError(attr)
class FacetSet(dict):
@ -153,7 +154,8 @@ class FacetSet(dict):
Treat this basically like a dictionary (which it inherits from).
"""
def _histogram(self, data, facet, res=3600):
@staticmethod
def _histogram(data, facet, res=3600):
"""A preprocessor for data should we want to bucket it."""
# NOTE(mriedem): We sometimes hit a case where the @timestamp attribute
# is too large and ES won't return it. At some point we should probably

View File

@ -118,7 +118,8 @@ class TestBotWithTestTools(tests.TestCase):
"gate-keystone-python27: unrecognized error")
self.assertEqual(reference, msg)
def fake_display(self, *args):
@staticmethod
def fake_display(*args):
return True
def test_error_found(self):