7 def test_lint_codespell_fix(lint
, create_temp_file
):
8 contents
= """This is a file with some typos and informations.
9 But also testing false positive like optin (because this isn't always option)
10 or stuff related to our coding style like:
12 but detects mistakes like mozila
15 path
= create_temp_file(contents
, "ignore.rst")
16 lint([path
], fix
=True)
21 def test_lint_codespell(lint
, paths
):
22 results
= lint(paths())
23 assert len(results
) == 2
25 assert results
[0].message
== "informations ==> information"
26 assert results
[0].level
== "error"
27 assert results
[0].lineno
== 1
28 assert results
[0].relpath
== "ignore.rst"
30 assert results
[1].message
== "mozila ==> mozilla"
31 assert results
[1].level
== "error"
32 assert results
[1].lineno
== 5
33 assert results
[1].relpath
== "ignore.rst"
36 if __name__
== "__main__":