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