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

Method test_stdfd_functional

testing/test_capture.py:516–527  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

514 result.stdout.fnmatch_lines(["xxx42xxx"])
515
516 def test_stdfd_functional(self, pytester: Pytester) -> None:
517 reprec = pytester.inline_runsource(
518 """\
519 def test_hello(capfd):
520 import os
521 os.write(1, b"42")
522 out, err = capfd.readouterr()
523 assert out.startswith("42")
524 capfd.close()
525 """
526 )
527 reprec.assertoutcome(passed=1)
528
529 @pytest.mark.parametrize("nl", ("\n", "\r\n", "\r"))
530 def test_cafd_preserves_newlines(self, capfd, nl) -> None:

Callers

nothing calls this directly

Calls 2

assertoutcomeMethod · 0.80
inline_runsourceMethod · 0.45

Tested by

no test coverage detected