From 648242fdb4ac6ee869792c4e4ca11656aed03863 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Thu, 21 Jan 2021 16:21:17 -0800 Subject: [PATCH] [pylint] Enable no-member check (#5034) --- .pylintrc | 1 - infra/build/functions/project_sync_test.py | 2 ++ infra/build/functions/request_build_test.py | 2 ++ infra/build/functions/request_coverage_build_test.py | 2 ++ infra/build/functions/update_build_status_test.py | 2 ++ infra/retry.py | 5 ++--- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 141ea83f5..9c1195583 100644 --- a/.pylintrc +++ b/.pylintrc @@ -141,7 +141,6 @@ disable=print-statement, comprehension-escape, fixme, import-error, - no-member # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/infra/build/functions/project_sync_test.py b/infra/build/functions/project_sync_test.py index 7992ba9ea..f90733810 100644 --- a/infra/build/functions/project_sync_test.py +++ b/infra/build/functions/project_sync_test.py @@ -32,6 +32,8 @@ from project_sync import ProjectMetadata from project_sync import sync_projects import test_utils +# pylint: disable=no-member + # pylint: disable=too-few-public-methods class Repository: diff --git a/infra/build/functions/request_build_test.py b/infra/build/functions/request_build_test.py index 171fa4043..22a4a1056 100644 --- a/infra/build/functions/request_build_test.py +++ b/infra/build/functions/request_build_test.py @@ -33,6 +33,8 @@ from request_build import get_project_data from request_build import update_build_history import test_utils +# pylint: disable=no-member + class TestRequestBuilds(unittest.TestCase): """Unit tests for sync.""" diff --git a/infra/build/functions/request_coverage_build_test.py b/infra/build/functions/request_coverage_build_test.py index 8a1cf4436..1327e36a0 100644 --- a/infra/build/functions/request_coverage_build_test.py +++ b/infra/build/functions/request_coverage_build_test.py @@ -30,6 +30,8 @@ from datastore_entities import Project from build_and_run_coverage import get_build_steps import test_utils +# pylint: disable=no-member + class TestRequestCoverageBuilds(unittest.TestCase): """Unit tests for sync.""" diff --git a/infra/build/functions/update_build_status_test.py b/infra/build/functions/update_build_status_test.py index db15b2a6b..6784fac2d 100644 --- a/infra/build/functions/update_build_status_test.py +++ b/infra/build/functions/update_build_status_test.py @@ -30,6 +30,8 @@ from datastore_entities import LastSuccessfulBuild import test_utils import update_build_status +# pylint: disable=no-member + # pylint: disable=too-few-public-methods class MockGetBuild: diff --git a/infra/retry.py b/infra/retry.py index 293da998e..1a94180c6 100644 --- a/infra/retry.py +++ b/infra/retry.py @@ -62,9 +62,8 @@ def wrap(retries, sleep(get_delay(num_try, delay, backoff)) return True - logging.log_error('Retrying on %s failed with %s. Raise.' % - (function_with_type, sys.exc_info()[1]), - total=tries) + logging.error('Retrying on %s failed with %s. Raise.', function_with_type, + sys.exc_info()[1]) return False @functools.wraps(func)