MCPcopy
hub / github.com/pallets/flask / test_open_resource_with_encoding

Function test_open_resource_with_encoding

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

Source from the content-addressed store, hash-verified

376
377@pytest.mark.parametrize("encoding", ("utf-8", "utf-16-le"))
378def test_open_resource_with_encoding(tmp_path, encoding):
379 app = flask.Flask(__name__, root_path=os.fspath(tmp_path))
380 (tmp_path / "test").write_text("test", encoding=encoding)
381
382 with app.open_resource("test", mode="rt", encoding=encoding) as f:
383 assert f.read() == "test"

Callers

nothing calls this directly

Calls 1

open_resourceMethod · 0.95

Tested by

no test coverage detected