(pgconn, tmp_path)
| 628 | @pytest.mark.libpq("< 14") |
| 629 | @pytest.mark.skipif("sys.platform != 'linux'") |
| 630 | def test_trace_pre14(pgconn, tmp_path): |
| 631 | tracef = tmp_path / "trace" |
| 632 | with tracef.open("w") as f: |
| 633 | pgconn.trace(f.fileno()) |
| 634 | with pytest.raises(psycopg.NotSupportedError): |
| 635 | pgconn.set_trace_flags(0) |
| 636 | pgconn.exec_(b"select 1") |
| 637 | pgconn.untrace() |
| 638 | pgconn.exec_(b"select 2") |
| 639 | traces = tracef.read_text() |
| 640 | assert "select 1" in traces |
| 641 | assert "select 2" not in traces |
| 642 | |
| 643 | |
| 644 | @pytest.mark.libpq(">= 14") |