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

Function test_fdopen_kept_alive_issue124

testing/test_terminal.py:1564–1579  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1562
1563@pytest.mark.xfail("not hasattr(os, 'dup')")
1564def test_fdopen_kept_alive_issue124(pytester: Pytester) -> None:
1565 pytester.makepyfile(
1566 """
1567 import os, sys
1568 k = []
1569 def test_open_file_and_keep_alive(capfd):
1570 stdout = os.fdopen(1, 'w', 1)
1571 k.append(stdout)
1572
1573 def test_close_kept_alive_file():
1574 stdout = k.pop()
1575 stdout.close()
1576 """
1577 )
1578 result = pytester.runpytest()
1579 result.stdout.fnmatch_lines(["*2 passed*"])
1580
1581
1582def test_tbstyle_native_setup_error(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected