MCPcopy Create free account
hub / github.com/pallets/flask / test_open_resource_with_encoding

Function test_open_resource_with_encoding

tests/test_helpers.py:355–360  ·  view source on GitHub ↗
(tmp_path, encoding)

Source from the content-addressed store, hash-verified

353
354@pytest.mark.parametrize("encoding", ("utf-8", "utf-16-le"))
355def test_open_resource_with_encoding(tmp_path, encoding):
356 app = flask.Flask(__name__, root_path=os.fspath(tmp_path))
357 (tmp_path / "test").write_text("test", encoding=encoding)
358
359 with app.open_resource("test", mode="rt", encoding=encoding) as f:
360 assert f.read() == "test"

Callers

nothing calls this directly

Calls 1

open_resourceMethod · 0.95

Tested by

no test coverage detected