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

Method test_simple

testing/test_capture.py:1036–1049  ·  view source on GitHub ↗
(self, tmpfile: BinaryIO)

Source from the content-addressed store, hash-verified

1034
1035class TestFDCapture:
1036 def test_simple(self, tmpfile: BinaryIO) -> None:
1037 fd = tmpfile.fileno()
1038 cap = capture.FDCapture(fd)
1039 data = b"hello"
1040 os.write(fd, data)
1041 with pytest.raises(AssertionError):
1042 cap.snap()
1043 cap.done()
1044 cap = capture.FDCapture(fd)
1045 cap.start()
1046 os.write(fd, data)
1047 s = cap.snap()
1048 cap.done()
1049 assert s == "hello"
1050
1051 def test_simple_many(self, tmpfile: BinaryIO) -> None:
1052 for i in range(10):

Callers 1

test_simple_manyMethod · 0.95

Calls 5

snapMethod · 0.95
filenoMethod · 0.45
writeMethod · 0.45
doneMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected