mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
Improve error handling and clarity in catch_dotenv hook and tests
This commit is contained in:
parent
33746f52ec
commit
989ac68f29
3 changed files with 138 additions and 23 deletions
|
|
@ -311,6 +311,8 @@ def test_atomic_write_failure_example(monkeypatch, tmp_path: Path, env_file: Pat
|
|||
os.chdir(cwd)
|
||||
# hook still blocks; but example creation failed -> message should not claim Example file generated
|
||||
assert ok is True
|
||||
out = capsys.readouterr().out
|
||||
captured = capsys.readouterr()
|
||||
out = captured.out
|
||||
err = captured.err
|
||||
assert 'Example file generated' not in out
|
||||
assert 'ERROR: unable to write' in out
|
||||
assert 'ERROR: unable to write' in err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue