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/.
7 from pprint
import pprint
8 from textwrap
import dedent
16 def test_lint_fix(lint
, create_temp_file
):
24 path
= create_temp_file(contents
, "bad.py")
25 lint([path
], fix
=True)
29 def test_lint_ruff(lint
, paths
):
30 results
= lint(paths())
31 pprint(results
, indent
=2)
32 assert len(results
) == 2
33 assert results
[0].level
== "error"
34 assert results
[0].relpath
== "bad.py"
35 assert "`distutils` imported but unused" in results
[0].message
38 if __name__
== "__main__":