-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for proper flake8 invocation of the checker
Add flake8 to the tox environment due to added subprocess call
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from subprocess import PIPE, run | ||
|
||
|
||
def test_checker_runs() -> None: | ||
"""Test that the checker is properly registered by Flake8 as needing to run on the input src.""" | ||
substr = "TYP001 Missing type annotation for function argument 'x'" | ||
p = run(["flake8", "-"], stdout=PIPE, input="def bar(x) -> None:\n pass\n", encoding="ascii") | ||
|
||
assert substr in p.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ deps = | |
pytest | ||
pytest-check | ||
pytest-cov | ||
flake8 | ||
|
||
[testenv:clean] | ||
deps = coverage | ||
|