1 # -*- coding: utf-8 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 def test_lint_fix(lint
, create_temp_file
):
14 contents
= """def is_unique(
22 for i in range(len(s) - 1):
29 if __name__ == "__main__":
34 path
= create_temp_file(contents
, "bad.py")
35 lint([path
], fix
=True)
39 def test_lint_black(lint
, paths
):
40 results
= lint(paths())
41 assert len(results
) == 2
43 assert results
[0].level
== "error"
44 assert results
[0].relpath
== "bad.py"
46 assert "EOF" in results
[1].message
47 assert results
[1].level
== "error"
48 assert results
[1].relpath
== "invalid.py"
51 if __name__
== "__main__":