summaryrefslogtreecommitdiff
path: root/tests/test_pragma_parser.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-20 14:09:16 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-20 14:32:11 +0200
commit15d2eaa13bd0d407dec693af730da9b675038996 (patch)
treeb9c47c04ef27e881920e5a7e4097d4084df6e6ae /tests/test_pragma_parser.py
parent74aa678f035b214b6de0fd6659b9864be6d37e95 (diff)
downloadpylint-git-15d2eaa13bd0d407dec693af730da9b675038996.tar.gz
[tests lint] Fix all W0612 unused-variable in pylint's own tests
Diffstat (limited to 'tests/test_pragma_parser.py')
-rw-r--r--tests/test_pragma_parser.py22
1 files changed, 6 insertions, 16 deletions
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)))