()
| 112 | |
| 113 | |
| 114 | def test_print_exception_locals(): |
| 115 | console = Console(width=100, file=io.StringIO()) |
| 116 | try: |
| 117 | 1 / 0 |
| 118 | except Exception: |
| 119 | console.print_exception(show_locals=True) |
| 120 | exception_text = console.file.getvalue() |
| 121 | print(exception_text) |
| 122 | assert "ZeroDivisionError" in exception_text |
| 123 | assert "locals" in exception_text |
| 124 | assert "console = <console width=100 None>" in exception_text |
| 125 | |
| 126 | |
| 127 | def test_syntax_error(): |
nothing calls this directly
no test coverage detected