mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 21:44:18 +00:00
add failing test for missing config file
This commit is contained in:
parent
a7be5e798b
commit
d478d92299
2 changed files with 24 additions and 0 deletions
|
|
@ -386,3 +386,21 @@ def test_early_keyboard_interrupt_does_not_crash(capsys):
|
|||
out, err = capsys.readouterr()
|
||||
assert out == "... stopped\n"
|
||||
assert err == ""
|
||||
|
||||
|
||||
def test_config_file_not_found(tmpdir, capsys):
|
||||
"""Ensure that an explicitly specified config file which is not found is an
|
||||
error"""
|
||||
|
||||
expected = """\
|
||||
There was a critical error during execution of Flake8:
|
||||
The specified config file does not exist
|
||||
"""
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
tmpdir.join("t.py").write("print('hello hello world')\n")
|
||||
assert cli.main(["--config", "missing.cfg", "t.py"]) == 1
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
assert out == expected
|
||||
assert err == ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue