(pytester: Pytester)
| 1744 | |
| 1745 | |
| 1746 | def test_libedit_workaround(pytester: Pytester) -> None: |
| 1747 | pytester.makeconftest(""" |
| 1748 | import pytest |
| 1749 | |
| 1750 | |
| 1751 | def pytest_terminal_summary(config): |
| 1752 | capture = config.pluginmanager.getplugin("capturemanager") |
| 1753 | capture.suspend_global_capture(in_=True) |
| 1754 | |
| 1755 | print("Enter 'hi'") |
| 1756 | value = input() |
| 1757 | print(f"value: {value!r}") |
| 1758 | |
| 1759 | capture.resume_global_capture() |
| 1760 | """) |
| 1761 | readline = pytest.importorskip("readline") |
| 1762 | backend = getattr(readline, "backend", readline.__doc__) # added in Python 3.13 |
| 1763 | print(f"Readline backend: {backend}") |
| 1764 | |
| 1765 | child = pytester.spawn_pytest("") |
| 1766 | child.expect(r"Enter 'hi'") |
| 1767 | child.sendline("hi") |
| 1768 | rest = child.read().decode("utf8") |
| 1769 | print(rest) |
| 1770 | match = re.search(r"^value: '(.*)'\r?$", rest, re.MULTILINE) |
| 1771 | assert match is not None |
| 1772 | assert match.group(1) == "hi" |
nothing calls this directly
no test coverage detected
searching dependent graphs…