mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 13:36:54 +00:00
Fix --output-file regression
This commit is contained in:
parent
b4d2850192
commit
4888eb65c5
5 changed files with 29 additions and 25 deletions
|
|
@ -246,3 +246,17 @@ def test_file_not_found(tmpdir, capsys):
|
|||
out, err = capsys.readouterr()
|
||||
assert out.startswith("i-do-not-exist:0:1: E902")
|
||||
assert err == ""
|
||||
|
||||
|
||||
def test_output_file(tmpdir, capsys):
|
||||
"""Ensure that --output-file is honored."""
|
||||
tmpdir.join('t.py').write('import os\n')
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
_call_main(['t.py', '--output-file=f'], retv=1)
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
assert out == err == ""
|
||||
|
||||
expected = "t.py:1:1: F401 'os' imported but unused\n"
|
||||
assert tmpdir.join('f').read() == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue