| 1618 | |
| 1619 | |
| 1620 | def 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 | |
| 1633 | def test__get_multicapture() -> None: |