Skip to content

Commit

Permalink
Add test for proper flake8 invocation of the checker
Browse files Browse the repository at this point in the history
Add flake8 to the tox environment due to added subprocess call
  • Loading branch information
sco1 committed Dec 19, 2019
1 parent 9ef76d1 commit 1dfaab8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testing/test_flake8_actually_runs_checker.py
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
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ deps =
pytest
pytest-check
pytest-cov
flake8

[testenv:clean]
deps = coverage
Expand Down

0 comments on commit 1dfaab8

Please sign in to comment.