Improve error handling and clarity in catch_dotenv hook and tests

This commit is contained in:
Chris Rowe 2025-08-28 20:29:12 -06:00
parent 33746f52ec
commit 989ac68f29
No known key found for this signature in database
3 changed files with 138 additions and 23 deletions

View file

@ -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