MCPcopy
hub / github.com/pallets/click / test_open_file_ignore_invalid_utf8

Function test_open_file_ignore_invalid_utf8

tests/test_utils.py:717–723  ·  view source on GitHub ↗
(runner)

Source from the content-addressed store, hash-verified

715
716
717def test_open_file_ignore_invalid_utf8(runner):
718 with runner.isolated_filesystem():
719 with open("test.txt", "wb") as f:
720 f.write(b"\xe2\x28\xa1")
721
722 with click.open_file("test.txt", encoding="utf8", errors="ignore") as f:
723 f.read()
724
725
726def test_open_file_ignore_no_encoding(runner):

Callers

nothing calls this directly

Calls 4

openFunction · 0.85
isolated_filesystemMethod · 0.80
readMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected