mirror of
https://github.com/esphome/esphome.git
synced 2025-09-01 10:52:19 +01:00
Bump black from 23.12.1 to 24.2.0 (#6221)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@@ -28,8 +28,9 @@ def test_write_utf8_file_fails_at_rename(
|
||||
test_dir = tmpdir.mkdir("files")
|
||||
test_file = Path(test_dir / "test.json")
|
||||
|
||||
with pytest.raises(OSError), patch(
|
||||
"esphome.dashboard.util.file.os.replace", side_effect=OSError
|
||||
with (
|
||||
pytest.raises(OSError),
|
||||
patch("esphome.dashboard.util.file.os.replace", side_effect=OSError),
|
||||
):
|
||||
write_utf8_file(test_file, '{"some":"data"}', False)
|
||||
|
||||
@@ -45,9 +46,11 @@ def test_write_utf8_file_fails_at_rename_and_remove(
|
||||
test_dir = tmpdir.mkdir("files")
|
||||
test_file = Path(test_dir / "test.json")
|
||||
|
||||
with pytest.raises(OSError), patch(
|
||||
"esphome.dashboard.util.file.os.remove", side_effect=OSError
|
||||
), patch("esphome.dashboard.util.file.os.replace", side_effect=OSError):
|
||||
with (
|
||||
pytest.raises(OSError),
|
||||
patch("esphome.dashboard.util.file.os.remove", side_effect=OSError),
|
||||
patch("esphome.dashboard.util.file.os.replace", side_effect=OSError),
|
||||
):
|
||||
write_utf8_file(test_file, '{"some":"data"}', False)
|
||||
|
||||
assert "File replacement cleanup failed" in caplog.text
|
||||
|
Reference in New Issue
Block a user