From: Denis Laxalde Date: Wed, 29 Sep 2021 08:36:23 +0000 (+0200) Subject: Adjust test on PGconn.tty for libpq 14 X-Git-Tag: 3.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2e8a980c125e78a1ddeba3139432c22e8108890;p=thirdparty%2Fpsycopg.git Adjust test on PGconn.tty for libpq 14 Quoting https://www.postgresql.org/docs/14/libpq-status.html: [PQtty] no longer does anything, but it remains for backwards compatibility. The function always return an empty string. Or perhaps we should drop 'tty' property (and binding), since this is at least obsolete since PostgreSQL 7.4? --- diff --git a/tests/pq/test_pgconn.py b/tests/pq/test_pgconn.py index cb00e10d1..89df2953e 100644 --- a/tests/pq/test_pgconn.py +++ b/tests/pq/test_pgconn.py @@ -224,6 +224,7 @@ def test_port(pgconn): pgconn.port +@pytest.mark.libpq("< 14") def test_tty(pgconn): tty = [o.val for o in pgconn.info if o.keyword == b"tty"][0] assert pgconn.tty == tty @@ -232,6 +233,12 @@ def test_tty(pgconn): pgconn.tty +@pytest.mark.libpq(">= 14") +def test_tty_noop(pgconn): + assert not any(o.val for o in pgconn.info if o.keyword == b"tty") + assert pgconn.tty == b"" + + def test_transaction_status(pgconn): assert pgconn.transaction_status == pq.TransactionStatus.IDLE pgconn.exec_(b"begin")