diff options
Diffstat (limited to 'tools/lint/test/test_pylint.py')
-rw-r--r-- | tools/lint/test/test_pylint.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/lint/test/test_pylint.py b/tools/lint/test/test_pylint.py new file mode 100644 index 0000000000..6ee2217089 --- /dev/null +++ b/tools/lint/test/test_pylint.py @@ -0,0 +1,24 @@ +import mozunit + +LINTER = "pylint" + + +def test_lint_single_file(lint, paths): + results = lint(paths("bad.py")) + assert len(results) == 3 + assert results[1].rule == "E0602" + assert results[2].rule == "W0101" + assert results[2].lineno == 5 + + # run lint again to make sure the previous results aren't counted twice + results = lint(paths("bad.py")) + assert len(results) == 3 + + +def test_lint_single_file_good(lint, paths): + results = lint(paths("good.py")) + assert len(results) == 0 + + +if __name__ == "__main__": + mozunit.main() |