()
| 81 | |
| 82 | |
| 83 | def test_interactive_render(): |
| 84 | # Simulate user typing '# hello', pressing Ctrl-D (renders), then Ctrl-C (exits) |
| 85 | # This is needed to break the infinite loop in interactive mode on EOF. |
| 86 | mock_input = patch( |
| 87 | "builtins.input", side_effect=["# hello", EOFError, KeyboardInterrupt] |
| 88 | ) |
| 89 | string_io = io.StringIO() |
| 90 | with redirect_stdout(string_io), mock_input: |
| 91 | parse.interactive() |
| 92 | |
| 93 | output = string_io.getvalue() |
| 94 | assert "markdown-it-py" in output # from print_heading |
| 95 | # The rendered output is prefixed by a newline |
| 96 | assert "\n<h1>hello</h1>\n" in output |
| 97 | assert "Exiting" in output |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…