mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix several ResourceWarning: unclosed file
This commit is contained in:
parent
abee146199
commit
67d6fcb0f6
10 changed files with 78 additions and 34 deletions
|
|
@ -87,11 +87,11 @@ def test_log_and_exit(cap_out, mock_store_dir):
|
|||
)
|
||||
|
||||
assert os.path.exists(log_file)
|
||||
contents = io.open(log_file).read()
|
||||
assert contents == (
|
||||
'msg: FatalError: hai\n'
|
||||
"I'm a stacktrace\n"
|
||||
)
|
||||
with io.open(log_file) as f:
|
||||
assert f.read() == (
|
||||
'msg: FatalError: hai\n'
|
||||
"I'm a stacktrace\n"
|
||||
)
|
||||
|
||||
|
||||
def test_error_handler_non_ascii_exception(mock_store_dir):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue