MCPcopy
hub / github.com/pytest-dev/pytest / test_encodedfile_writelines

Function test_encodedfile_writelines

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

Source from the content-addressed store, hash-verified

1696
1697
1698def test_encodedfile_writelines(tmpfile: BinaryIO) -> None:
1699 ef = capture.EncodedFile(tmpfile, encoding="utf-8")
1700 with pytest.raises(TypeError):
1701 ef.writelines([b"line1", b"line2"]) # type: ignore[list-item]
1702 assert ef.writelines(["line3", "line4"]) is None # type: ignore[func-returns-value]
1703 ef.flush()
1704 tmpfile.seek(0)
1705 assert tmpfile.read() == b"line3line4"
1706 tmpfile.close()
1707 with pytest.raises(ValueError):
1708 ef.read()
1709
1710
1711def test__get_multicapture() -> None:

Callers

nothing calls this directly

Calls 5

writelinesMethod · 0.80
seekMethod · 0.80
flushMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected