summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/.test_pylintrc1
-rw-r--r--tests/extensions/test_check_docs.py4
-rw-r--r--tests/message/unittest_message_definition_store.py2
-rw-r--r--tests/message/unittest_message_id_store.py6
-rw-r--r--tests/test_functional.py2
-rw-r--r--tests/test_pragma_parser.py22
6 files changed, 13 insertions, 24 deletions
diff --git a/tests/.test_pylintrc b/tests/.test_pylintrc
index e7155bc1f..2b5ccc122 100644
--- a/tests/.test_pylintrc
+++ b/tests/.test_pylintrc
@@ -24,7 +24,6 @@ disable=
too-many-public-methods,
unused-argument,
undefined-loop-variable,
- unused-variable,
no-member,
missing-type-doc,
bare-except,
diff --git a/tests/extensions/test_check_docs.py b/tests/extensions/test_check_docs.py
index 90ccf6334..ceec4324e 100644
--- a/tests/extensions/test_check_docs.py
+++ b/tests/extensions/test_check_docs.py
@@ -1830,7 +1830,7 @@ class TestParamDocChecker(CheckerTestCase):
"""Example of a property having missing return documentation in
a Sphinx style docstring
"""
- property_node, node = astroid.extract_node(
+ _, node = astroid.extract_node(
"""
class Foo(object):
@property
@@ -1872,7 +1872,7 @@ class TestParamDocChecker(CheckerTestCase):
"""Example of a property having return documentation in
a Google style docstring
"""
- property_node, node = astroid.extract_node(
+ _, node = astroid.extract_node(
"""
class Foo(object):
@property
diff --git a/tests/message/unittest_message_definition_store.py b/tests/message/unittest_message_definition_store.py
index 208fff4ed..28acc5930 100644
--- a/tests/message/unittest_message_definition_store.py
+++ b/tests/message/unittest_message_definition_store.py
@@ -140,7 +140,7 @@ def test_register_error_new_id_duplicate_of_new(empty_store):
empty_store.register_messages_from_checker(CheckerOne())
test_register_error(
empty_store,
- {"W1234": ("message two", "msg-symbol-two", "another msg description.")},
+ CheckerTwo.msgs,
"Message id 'W1234' cannot have both 'msg-symbol-one' and 'msg-symbol-two' as symbolic name.",
)
diff --git a/tests/message/unittest_message_id_store.py b/tests/message/unittest_message_id_store.py
index d3a95ed2e..aeb63cfa1 100644
--- a/tests/message/unittest_message_id_store.py
+++ b/tests/message/unittest_message_id_store.py
@@ -43,7 +43,7 @@ def test_get_message_ids_not_existing(empty_msgid_store):
def test_register_message_definitions(empty_msgid_store, message_definitions):
number_of_msgid = len(message_definitions)
- for i, message_definition in enumerate(message_definitions):
+ for message_definition in message_definitions:
empty_msgid_store.register_message_definition(message_definition)
if message_definition.old_names:
number_of_msgid += len(message_definition.old_names)
@@ -64,9 +64,9 @@ def test_add_msgid_and_symbol(empty_msgid_store):
assert empty_msgid_store.get_symbol("E1235") == "new-sckiil"
assert empty_msgid_store.get_msgid("old-sckiil") == "C1235"
assert empty_msgid_store.get_msgid("new-sckiil") == "E1235"
- with pytest.raises(KeyError) as e:
+ with pytest.raises(KeyError):
empty_msgid_store.get_symbol("C1234")
- with pytest.raises(KeyError) as e:
+ with pytest.raises(KeyError):
empty_msgid_store.get_msgid("not-exist")
diff --git a/tests/test_functional.py b/tests/test_functional.py
index 106ad0b2e..add4bdcbe 100644
--- a/tests/test_functional.py
+++ b/tests/test_functional.py
@@ -64,7 +64,7 @@ class LintModuleOutputUpdate(testutils.LintModuleTest):
def get_tests():
input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional")
suite = []
- for dirpath, dirnames, filenames in os.walk(input_dir):
+ for dirpath, _, filenames in os.walk(input_dir):
if dirpath.endswith("__pycache__"):
continue
for filename in filenames:
diff --git a/tests/test_pragma_parser.py b/tests/test_pragma_parser.py
index 48a435534..1aaed30d5 100644
--- a/tests/test_pragma_parser.py
+++ b/tests/test_pragma_parser.py
@@ -46,49 +46,39 @@ def test_missing_assignment():
comment = "#pylint: disable missing-docstring"
match = OPTION_PO.search(comment)
with pytest.raises(InvalidPragmaError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
+ list(parse_pragma(match.group(2)))
def test_missing_keyword():
comment = "#pylint: = missing-docstring"
match = OPTION_PO.search(comment)
with pytest.raises(InvalidPragmaError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
+ list(parse_pragma(match.group(2)))
def test_unsupported_assignment():
comment = "#pylint: disable-all = missing-docstring"
match = OPTION_PO.search(comment)
with pytest.raises(UnRecognizedOptionError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
+ list(parse_pragma(match.group(2)))
def test_unknown_keyword_with_messages():
comment = "#pylint: unknown-keyword = missing-docstring"
match = OPTION_PO.search(comment)
with pytest.raises(UnRecognizedOptionError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
+ list(parse_pragma(match.group(2)))
def test_unknown_keyword_without_messages():
comment = "#pylint: unknown-keyword"
match = OPTION_PO.search(comment)
with pytest.raises(UnRecognizedOptionError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
+ list(parse_pragma(match.group(2)))
def test_missing_message():
comment = "#pylint: disable = "
match = OPTION_PO.search(comment)
with pytest.raises(InvalidPragmaError):
- for pragma_repr in parse_pragma(match.group(2)):
- pass
-
-
-if __name__ == "__main__":
- test_missing_message()
+ list(parse_pragma(match.group(2)))