From cbd7a095c0e8ab80a6b7cca1ae71641e74e8e2bc Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 2 Feb 2017 10:05:06 -0800 Subject: tests: Instruct pylint to ignore a large swath of warnings There are a number of things pylint warns on that absolutely make sense to fix in production code, but for unittests they either don't matter (like naming variables "foo"), can't be fixed (TestCase methods that don't use self because they use a mock assert), or the descriptive names violate PEP8. These are annoying and create noise, so tell pylint to ignore them. --- tests/utils/argparse_test.py | 10 +++++++++- tests/utils/configobj_test.py | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/utils') diff --git a/tests/utils/argparse_test.py b/tests/utils/argparse_test.py index b208da8c..91f8a3f4 100644 --- a/tests/utils/argparse_test.py +++ b/tests/utils/argparse_test.py @@ -29,6 +29,14 @@ import mock from alot.utils import argparse as cargparse +# Good descriptive test names often don't fit PEP8, which is meant to cover +# functions meant to be called by humans. +# pylint: disable=invalid-name + +# When using mock asserts its possible that many methods will not use self, +# that's fine +# pylint: disable=no-self-use + class TestValidatedStore(unittest.TestCase): """Tests for the ValidatedStore action class.""" @@ -56,7 +64,7 @@ class TestValidatedStore(unittest.TestCase): @contextlib.contextmanager -def temporary_directory(suffix='', prefix='', dir=None): +def temporary_directory(suffix='', prefix='', dir=None): # pylint: disable=redefined-builtin """Python3 interface implementation. Python3 provides a class that can be used as a context manager, which diff --git a/tests/utils/configobj_test.py b/tests/utils/configobj_test.py index 9b212f29..65747328 100644 --- a/tests/utils/configobj_test.py +++ b/tests/utils/configobj_test.py @@ -5,6 +5,10 @@ import unittest from alot.utils import configobj as checks +# Good descriptive test names often don't fit PEP8, which is meant to cover +# functions meant to be called by humans. +# pylint: disable=invalid-name + class TestForceList(unittest.TestCase): -- cgit v1.2.3