diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-01-30 14:39:24 -0800 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-01-30 14:39:24 -0800 |
| commit | b0ecf3d28f200721968c8013d72c7e3215c2de70 (patch) | |
| tree | 0546ab69525b1d5e3be59069f78bb10c7f2505f7 /tests/integration | |
| parent | 3d1a4265a76831d2821b5d56036db2bbcc44b1c6 (diff) | |
| download | flake8-b0ecf3d28f200721968c8013d72c7e3215c2de70.tar.gz | |
Fix flake8 --statistics
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/test_main.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/integration/test_main.py b/tests/integration/test_main.py index d67cf86..56f9414 100644 --- a/tests/integration/test_main.py +++ b/tests/integration/test_main.py @@ -6,7 +6,7 @@ from flake8.main import application def test_diff_option(tmpdir, capsys): - """Ensure that FileChecker can handle --diff.""" + """Ensure that `flake8 --diff` works.""" t_py_contents = '''\ import os import sys # unused but not part of diff @@ -41,3 +41,20 @@ index d64ac39..7d943de 100644 out, err = capsys.readouterr() assert out == "t.py:8:1: F821 undefined name 'y'\n" assert err == '' + + +def test_statistics_option(tmpdir, capsys): + """Ensure that `flake8 --statistics` works.""" + with tmpdir.as_cwd(): + tmpdir.join('t.py').write('import os\nimport sys\n') + + app = application.Application() + app.run(['--statistics', 't.py']) + + out, err = capsys.readouterr() + assert out == '''\ +t.py:1:1: F401 'os' imported but unused +t.py:2:1: F401 'sys' imported but unused +2 F401 'os' imported but unused +''' + assert err == '' |
