MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_encodedfile_writelines

Function test_encodedfile_writelines

testing/test_capture.py:1620–1630  ·  view source on GitHub ↗
(tmpfile: BinaryIO)

Source from the content-addressed store, hash-verified

1618
1619
1620def test_encodedfile_writelines(tmpfile: BinaryIO) -> None:
1621 ef = capture.EncodedFile(tmpfile, encoding="utf-8")
1622 with pytest.raises(TypeError):
1623 ef.writelines([b"line1", b"line2"]) # type: ignore[list-item]
1624 assert ef.writelines(["line3", "line4"]) is None # type: ignore[func-returns-value]
1625 ef.flush()
1626 tmpfile.seek(0)
1627 assert tmpfile.read() == b"line3line4"
1628 tmpfile.close()
1629 with pytest.raises(ValueError):
1630 ef.read()
1631
1632
1633def test__get_multicapture() -> None:

Callers

nothing calls this directly

Calls 3

flushMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected