From: Daniele Varrazzo Date: Tue, 7 Jun 2022 21:28:11 +0000 (+0200) Subject: test(crdb): use the crdb_skip marker X-Git-Tag: 3.1~49^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67bc3adf0e98f47ddfe300d6676c540b77013220;p=thirdparty%2Fpsycopg.git test(crdb): use the crdb_skip marker Enable cancel-based tests on CRDB 22. --- diff --git a/tests/fix_crdb.py b/tests/fix_crdb.py index 14df5f60b..ad6669dd2 100644 --- a/tests/fix_crdb.py +++ b/tests/fix_crdb.py @@ -109,6 +109,7 @@ _crdb_reasons = { "large objects": 243, "negative interval": 81577, "nested array": 32552, + "no col query": None, "notify": 41522, "password_encryption": 42519, "pg_terminate_backend": 35897, diff --git a/tests/fix_psycopg.py b/tests/fix_psycopg.py index 0c3b2960a..80e0c626d 100644 --- a/tests/fix_psycopg.py +++ b/tests/fix_psycopg.py @@ -24,7 +24,7 @@ def global_adapters(): @pytest.fixture -@pytest.mark.crdb("skip", reason="2-phase commit") +@pytest.mark.crdb_skip("2-phase commit") def tpc(svcconn): tpc = Tpc(svcconn) tpc.check_tpc() diff --git a/tests/pool/test_null_pool.py b/tests/pool/test_null_pool.py index e3d64c45c..4c44d0ce7 100644 --- a/tests/pool/test_null_pool.py +++ b/tests/pool/test_null_pool.py @@ -54,7 +54,7 @@ def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_its_no_pool_at_all(dsn): with NullConnectionPool(dsn, max_size=2) as p: with p.connection() as conn: @@ -168,7 +168,7 @@ def test_configure_broken(dsn, caplog): assert "WAT" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_reset(dsn): resets = 0 @@ -211,7 +211,7 @@ def test_reset(dsn): assert pids[0] == pids[1] -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_reset_badstate(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -242,7 +242,7 @@ def test_reset_badstate(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_reset_broken(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -285,7 +285,7 @@ def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue(dsn): def worker(n): t0 = time() @@ -352,7 +352,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -413,7 +413,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -446,7 +446,7 @@ def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_broken_reconnect(dsn): with NullConnectionPool(dsn, max_size=1) as p: with p.connection() as conn: @@ -461,7 +461,7 @@ def test_broken_reconnect(dsn): assert pid1 != pid2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_intrans_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -494,7 +494,7 @@ def test_intrans_rollback(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_inerror_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -525,7 +525,7 @@ def test_inerror_rollback(dsn, caplog): assert "INERROR" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -554,7 +554,7 @@ def test_active_close(dsn, caplog): assert "BAD" in caplog.records[1].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_fail_rollback_close(dsn, caplog, monkeypatch): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -779,7 +779,7 @@ def test_bad_resize(dsn, min_size, max_size): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_max_lifetime(dsn): pids = [] diff --git a/tests/pool/test_null_pool_async.py b/tests/pool/test_null_pool_async.py index f88d76a94..ca449265b 100644 --- a/tests/pool/test_null_pool_async.py +++ b/tests/pool/test_null_pool_async.py @@ -56,7 +56,7 @@ async def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_its_no_pool_at_all(dsn): async with AsyncNullConnectionPool(dsn, max_size=2) as p: async with p.connection() as conn: @@ -170,7 +170,7 @@ async def test_configure_broken(dsn, caplog): assert "WAT" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_reset(dsn): resets = 0 @@ -212,7 +212,7 @@ async def test_reset(dsn): assert pids[0] == pids[1] -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_reset_badstate(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -242,7 +242,7 @@ async def test_reset_badstate(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_reset_broken(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -286,7 +286,7 @@ async def test_no_queue_timeout(deaf_port): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -345,7 +345,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -399,7 +399,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -428,7 +428,7 @@ async def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_broken_reconnect(dsn): async with AsyncNullConnectionPool(dsn, max_size=1) as p: async with p.connection() as conn: @@ -443,7 +443,7 @@ async def test_broken_reconnect(dsn): assert pid1 != pid2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_intrans_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -476,7 +476,7 @@ async def test_intrans_rollback(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_inerror_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -504,7 +504,7 @@ async def test_inerror_rollback(dsn, caplog): assert "INERROR" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -532,7 +532,7 @@ async def test_active_close(dsn, caplog): assert "BAD" in caplog.records[1].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_fail_rollback_close(dsn, caplog, monkeypatch): caplog.set_level(logging.WARNING, logger="psycopg.pool") pids = [] @@ -739,7 +739,7 @@ async def test_bad_resize(dsn, min_size, max_size): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_max_lifetime(dsn): pids: List[int] = [] diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 22d0bfe8b..373ff5aba 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -64,7 +64,7 @@ def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_its_really_a_pool(dsn): with pool.ConnectionPool(dsn, min_size=2) as p: with p.connection() as conn: @@ -85,7 +85,7 @@ def test_context(dsn): assert p.closed -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_connection_not_lost(dsn): with pool.ConnectionPool(dsn, min_size=1) as p: with pytest.raises(ZeroDivisionError): @@ -247,7 +247,7 @@ def test_reset(dsn): assert resets == 2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_reset_badstate(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -268,7 +268,7 @@ def test_reset_badstate(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_reset_broken(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -292,7 +292,7 @@ def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue(dsn): def worker(n): t0 = time() @@ -359,7 +359,7 @@ def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue_timeout(dsn): def worker(n): t0 = time() @@ -421,7 +421,7 @@ def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_queue_timeout_override(dsn): def worker(n): t0 = time() @@ -454,7 +454,7 @@ def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_broken_reconnect(dsn): with pool.ConnectionPool(dsn, min_size=1) as p: with p.connection() as conn: @@ -469,7 +469,7 @@ def test_broken_reconnect(dsn): assert pid1 != pid2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_intrans_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -491,7 +491,7 @@ def test_intrans_rollback(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_inerror_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -511,7 +511,7 @@ def test_inerror_rollback(dsn, caplog): assert "INERROR" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -531,7 +531,7 @@ def test_active_close(dsn, caplog): assert "BAD" in caplog.records[1].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_fail_rollback_close(dsn, caplog, monkeypatch): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -996,7 +996,7 @@ def test_jitter(): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_max_lifetime(dsn): with pool.ConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p: sleep(0.1) @@ -1009,7 +1009,7 @@ def test_max_lifetime(dsn): assert pids[0] == pids[1] != pids[4], pids -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") def test_check(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") with pool.ConnectionPool(dsn, min_size=4) as p: diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index b04b2566e..a541efb18 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -57,7 +57,7 @@ async def test_kwargs(dsn): assert conn.autocommit -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_its_really_a_pool(dsn): async with pool.AsyncConnectionPool(dsn, min_size=2) as p: async with p.connection() as conn: @@ -78,7 +78,7 @@ async def test_context(dsn): assert p.closed -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_connection_not_lost(dsn): async with pool.AsyncConnectionPool(dsn, min_size=1) as p: with pytest.raises(ZeroDivisionError): @@ -244,7 +244,7 @@ async def test_reset(dsn): assert resets == 2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_reset_badstate(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -265,7 +265,7 @@ async def test_reset_badstate(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_reset_broken(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -289,7 +289,7 @@ async def test_reset_broken(dsn, caplog): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue(dsn): async def worker(n): t0 = time() @@ -348,7 +348,7 @@ async def test_queue_size(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue_timeout(dsn): async def worker(n): t0 = time() @@ -403,7 +403,7 @@ async def test_dead_client(dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_queue_timeout_override(dsn): async def worker(n): t0 = time() @@ -432,7 +432,7 @@ async def test_queue_timeout_override(dsn): assert 0.1 < e[1] < 0.15 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_broken_reconnect(dsn): async with pool.AsyncConnectionPool(dsn, min_size=1) as p: async with p.connection() as conn: @@ -447,7 +447,7 @@ async def test_broken_reconnect(dsn): assert pid1 != pid2 -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_intrans_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -470,7 +470,7 @@ async def test_intrans_rollback(dsn, caplog): assert "INTRANS" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_inerror_rollback(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -490,7 +490,7 @@ async def test_inerror_rollback(dsn, caplog): assert "INERROR" in caplog.records[0].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_active_close(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -510,7 +510,7 @@ async def test_active_close(dsn, caplog): assert "BAD" in caplog.records[1].message -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_fail_rollback_close(dsn, caplog, monkeypatch): caplog.set_level(logging.WARNING, logger="psycopg.pool") @@ -944,7 +944,7 @@ async def test_jitter(): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_max_lifetime(dsn): async with pool.AsyncConnectionPool(dsn, min_size=1, max_lifetime=0.2) as p: await asyncio.sleep(0.1) @@ -957,7 +957,7 @@ async def test_max_lifetime(dsn): assert pids[0] == pids[1] != pids[4], pids -@pytest.mark.crdb("skip", reason="backend pid") +@pytest.mark.crdb_skip("backend pid") async def test_check(dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg.pool") async with pool.AsyncConnectionPool(dsn, min_size=4) as p: diff --git a/tests/pq/test_async.py b/tests/pq/test_async.py index 113b54844..2c3de9814 100644 --- a/tests/pq/test_async.py +++ b/tests/pq/test_async.py @@ -189,7 +189,7 @@ def test_send_describe_prepared(pgconn): pgconn.send_describe_prepared(b"prep") -@pytest.mark.crdb("skip", reason="server-side cursor") +@pytest.mark.crdb_skip("server-side cursor") def test_send_describe_portal(pgconn): res = pgconn.exec_( b""" diff --git a/tests/pq/test_copy.py b/tests/pq/test_copy.py index cec848b2a..383d272a2 100644 --- a/tests/pq/test_copy.py +++ b/tests/pq/test_copy.py @@ -3,7 +3,7 @@ import pytest import psycopg from psycopg import pq -pytestmark = pytest.mark.crdb("skip", reason="copy") +pytestmark = pytest.mark.crdb_skip("copy") sample_values = "values (10::int, 20::int, 'hello'::text), (40, NULL, 'world')" diff --git a/tests/pq/test_exec.py b/tests/pq/test_exec.py index 3ae4eeb16..86c30c099 100644 --- a/tests/pq/test_exec.py +++ b/tests/pq/test_exec.py @@ -126,7 +126,7 @@ def test_exec_prepared_binary_out(pgconn, fmt, out): assert res.get_value(0, 0) == out -@pytest.mark.crdb("skip", reason="server-side cursor") +@pytest.mark.crdb_skip("server-side cursor") def test_describe_portal(pgconn): res = pgconn.exec_( b""" diff --git a/tests/pq/test_misc.py b/tests/pq/test_misc.py index eef4d2dac..599758fd3 100644 --- a/tests/pq/test_misc.py +++ b/tests/pq/test_misc.py @@ -22,7 +22,7 @@ def test_error_message(pgconn): assert "NULL" in pq.error_message(pgconn) -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") def test_error_message_encoding(pgconn): res = pgconn.exec_(b"set client_encoding to latin9") assert res.status == pq.ExecStatus.COMMAND_OK diff --git a/tests/pq/test_pgconn.py b/tests/pq/test_pgconn.py index 6f339617b..663511a4d 100644 --- a/tests/pq/test_pgconn.py +++ b/tests/pq/test_pgconn.py @@ -131,7 +131,7 @@ def test_info(dsn, pgconn): pgconn.info -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_reset(pgconn): assert pgconn.status == pq.ConnStatus.OK pgconn.exec_(b"select pg_terminate_backend(pg_backend_pid())") @@ -146,7 +146,7 @@ def test_reset(pgconn): assert pgconn.status == pq.ConnStatus.BAD -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_reset_async(pgconn): assert pgconn.status == pq.ConnStatus.OK pgconn.exec_(b"select pg_terminate_backend(pg_backend_pid())") @@ -272,7 +272,7 @@ def test_parameter_status(dsn, monkeypatch): pgconn.parameter_status(b"application_name") -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") def test_encoding(pgconn): res = pgconn.exec_(b"set client_encoding to latin1") assert res.status == pq.ExecStatus.COMMAND_OK @@ -402,7 +402,7 @@ def test_cancel_free(pgconn): cancel.free() -@pytest.mark.crdb("skip", reason="notify") +@pytest.mark.crdb_skip("notify") def test_notify(pgconn): assert pgconn.notifies() is None @@ -430,7 +430,7 @@ def test_notify(pgconn): assert pgconn.notifies() is None -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") def test_notice_nohandler(pgconn): pgconn.exec_(b"set client_min_messages to notice") res = pgconn.exec_( @@ -439,7 +439,7 @@ def test_notice_nohandler(pgconn): assert res.status == pq.ExecStatus.COMMAND_OK -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") def test_notice(pgconn): msgs = [] @@ -457,7 +457,7 @@ def test_notice(pgconn): assert msgs and msgs[0] == b"hello notice" -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") def test_notice_error(pgconn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") @@ -538,7 +538,7 @@ def test_encrypt_password_badalgo(pgconn): @pytest.mark.libpq(">= 10") -@pytest.mark.crdb("skip", reason="password_encryption") +@pytest.mark.crdb_skip("password_encryption") def test_encrypt_password_query(pgconn): res = pgconn.exec_(b"set password_encryption to 'md5'") assert res.status == pq.ExecStatus.COMMAND_OK, pgconn.error_message.decode() diff --git a/tests/test_client_cursor.py b/tests/test_client_cursor.py index c2cf43e4a..fd733984b 100644 --- a/tests/test_client_cursor.py +++ b/tests/test_client_cursor.py @@ -586,7 +586,7 @@ def test_query_params_executemany(conn): assert cur._query.params == (b"3", b"4") -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("ph, params", [("%s", (10,)), ("%(n)s", {"n": 10})]) def test_copy_out_param(conn, ph, params): cur = conn.cursor() @@ -705,7 +705,7 @@ class TestColumn: unpickled = pickle.loads(pickled) assert [tuple(d) for d in description] == [tuple(d) for d in unpickled] - @pytest.mark.crdb("skip", reason="no col query") + @pytest.mark.crdb_skip("no col query") def test_no_col_query(self, conn): cur = conn.execute("select") assert cur.description == [] diff --git a/tests/test_client_cursor_async.py b/tests/test_client_cursor_async.py index b73173900..adcea69c6 100644 --- a/tests/test_client_cursor_async.py +++ b/tests/test_client_cursor_async.py @@ -581,7 +581,7 @@ async def test_query_params_executemany(aconn): assert cur._query.params == (b"3", b"4") -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("ph, params", [("%s", (10,)), ("%(n)s", {"n": 10})]) async def test_copy_out_param(aconn, ph, params): cur = aconn.cursor() diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 18c716127..4a60bbf67 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -109,7 +109,7 @@ t.join() @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="notify") +@pytest.mark.crdb_skip("notify") def test_notifies(conn_cls, conn, dsn): nconn = conn_cls.connect(dsn, autocommit=True) npid = nconn.pgconn.backend_pid @@ -162,7 +162,7 @@ def canceller(conn, errors): @pytest.mark.slow -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") def test_cancel(conn): errors: List[Exception] = [] @@ -186,7 +186,7 @@ def test_cancel(conn): @pytest.mark.slow -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") def test_cancel_stream(conn): errors: List[Exception] = [] @@ -210,7 +210,7 @@ def test_cancel_stream(conn): t.join() -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") @pytest.mark.slow def test_identify_closure(conn_cls, dsn): def closer(): @@ -240,7 +240,7 @@ def test_identify_closure(conn_cls, dsn): @pytest.mark.skipif( sys.platform == "win32", reason="don't know how to Ctrl-C on Windows" ) -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") def test_ctrl_c(dsn): if sys.platform == "win32": sig = int(signal.CTRL_C_EVENT) diff --git a/tests/test_concurrency_async.py b/tests/test_concurrency_async.py index 06f660f81..29b08cf1b 100644 --- a/tests/test_concurrency_async.py +++ b/tests/test_concurrency_async.py @@ -61,7 +61,7 @@ async def test_concurrent_execution(aconn_cls, dsn): @pytest.mark.slow @pytest.mark.timing -@pytest.mark.crdb("skip", reason="notify") +@pytest.mark.crdb_skip("notify") async def test_notifies(aconn_cls, aconn, dsn): nconn = await aconn_cls.connect(dsn, autocommit=True) npid = nconn.pgconn.backend_pid @@ -112,7 +112,7 @@ async def canceller(aconn, errors): @pytest.mark.slow -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") async def test_cancel(aconn): async def worker(): cur = aconn.cursor() @@ -137,7 +137,7 @@ async def test_cancel(aconn): @pytest.mark.slow -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") async def test_cancel_stream(aconn): async def worker(): cur = aconn.cursor() @@ -163,7 +163,7 @@ async def test_cancel_stream(aconn): @pytest.mark.slow -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") async def test_identify_closure(aconn_cls, dsn): async def closer(): await asyncio.sleep(0.2) @@ -193,7 +193,7 @@ async def test_identify_closure(aconn_cls, dsn): @pytest.mark.skipif( sys.platform == "win32", reason="don't know how to Ctrl-C on Windows" ) -@pytest.mark.crdb("skip", reason="cancel") +@pytest.mark.crdb_skip("cancel") async def test_ctrl_c(dsn): script = f"""\ import signal diff --git a/tests/test_connection.py b/tests/test_connection.py index ff085bb1e..59c044694 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -66,7 +66,7 @@ def test_close(conn): cur.execute("select 1") -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_broken(conn): with pytest.raises(psycopg.OperationalError): conn.execute("select pg_terminate_backend(%s)", [conn.pgconn.backend_pid]) @@ -158,7 +158,7 @@ def test_context_close(conn): conn.close() -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_context_inerror_rollback_no_clobber(conn_cls, conn, dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") @@ -177,7 +177,7 @@ def test_context_inerror_rollback_no_clobber(conn_cls, conn, dsn, caplog): assert "in rollback" in rec.message -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") def test_context_active_rollback_no_clobber(conn_cls, dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") @@ -221,7 +221,7 @@ def test_commit(conn): conn.commit() -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") def test_commit_error(conn): conn.execute( """ @@ -391,7 +391,7 @@ def test_connect_badargs(conn_cls, monkeypatch, pgconn, args, kwargs, exctype): conn_cls.connect(*args, **kwargs) -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_broken_connection(conn): cur = conn.cursor() with pytest.raises(psycopg.DatabaseError): @@ -399,7 +399,7 @@ def test_broken_connection(conn): assert conn.closed -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") def test_notice_handlers(conn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") messages = [] @@ -441,7 +441,7 @@ def test_notice_handlers(conn, caplog): conn.remove_notice_handler(cb1) -@pytest.mark.crdb("skip", reason="notify") +@pytest.mark.crdb_skip("notify") def test_notify_handlers(conn): nots1 = [] nots2 = [] @@ -611,7 +611,7 @@ tx_values_map["off"] = False tx_params = [ param_isolation, param_read_only, - pytest.param(param_deferrable, marks=pytest.mark.crdb("skip", reason="deferrable")), + pytest.param(param_deferrable, marks=pytest.mark.crdb_skip("deferrable")), ] tx_params_isolation = [ pytest.param( @@ -619,7 +619,7 @@ tx_params_isolation = [ marks=pytest.mark.crdb("skip", reason="transaction isolation"), ), param_read_only, - pytest.param(param_deferrable, marks=pytest.mark.crdb("skip", reason="deferrable")), + pytest.param(param_deferrable, marks=pytest.mark.crdb_skip("deferrable")), ] diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index 5f3c832b0..c6971cae1 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -71,7 +71,7 @@ async def test_close(aconn): await cur.execute("select 1") -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") async def test_broken(aconn): with pytest.raises(psycopg.OperationalError): await aconn.execute( @@ -161,7 +161,7 @@ async def test_context_close(aconn): await aconn.close() -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") async def test_context_inerror_rollback_no_clobber(aconn_cls, conn, dsn, caplog): with pytest.raises(ZeroDivisionError): async with await aconn_cls.connect(dsn) as conn2: @@ -178,7 +178,7 @@ async def test_context_inerror_rollback_no_clobber(aconn_cls, conn, dsn, caplog) assert "in rollback" in rec.message -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") async def test_context_active_rollback_no_clobber(aconn_cls, dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") @@ -222,7 +222,7 @@ async def test_commit(aconn): await aconn.commit() -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") async def test_commit_error(aconn): await aconn.execute( """ @@ -397,7 +397,7 @@ async def test_connect_badargs(aconn_cls, monkeypatch, pgconn, args, kwargs, exc await aconn_cls.connect(*args, **kwargs) -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") async def test_broken_connection(aconn): cur = aconn.cursor() with pytest.raises(psycopg.DatabaseError): @@ -405,7 +405,7 @@ async def test_broken_connection(aconn): assert aconn.closed -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") async def test_notice_handlers(aconn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") messages = [] @@ -449,7 +449,7 @@ async def test_notice_handlers(aconn, caplog): aconn.remove_notice_handler(cb1) -@pytest.mark.crdb("skip", reason="notify") +@pytest.mark.crdb_skip("notify") async def test_notify_handlers(aconn): nots1 = [] nots2 = [] diff --git a/tests/test_conninfo.py b/tests/test_conninfo.py index a8111702e..34bfa40c5 100644 --- a/tests/test_conninfo.py +++ b/tests/test_conninfo.py @@ -229,7 +229,7 @@ class TestConnectionInfo: with pytest.raises(psycopg.OperationalError): conn.info.error_message - @pytest.mark.crdb("skip", reason="backend pid") + @pytest.mark.crdb_skip("backend pid") def test_backend_pid(self, conn): assert conn.info.backend_pid assert conn.info.backend_pid == conn.pgconn.backend_pid @@ -306,7 +306,7 @@ class TestConnectionInfo: assert clienc.replace("-", "").replace("_", "").upper() == out assert conn.info.encoding == codec - @pytest.mark.crdb("skip", reason="encoding") + @pytest.mark.crdb_skip("encoding") def test_set_encoding_unsupported(self, conn): cur = conn.cursor() cur.execute("set client_encoding to EUC_TW") diff --git a/tests/test_copy.py b/tests/test_copy.py index 5eb8174d8..c02483a3b 100644 --- a/tests/test_copy.py +++ b/tests/test_copy.py @@ -19,7 +19,7 @@ from psycopg.types.numeric import Int4 from .utils import eur, gc_collect -pytestmark = pytest.mark.crdb("skip", reason="copy") +pytestmark = pytest.mark.crdb_skip("copy") sample_records = [(10, 20, "hello"), (40, None, "world")] sample_values = "values (10::int, 20::int, 'hello'::text), (40, NULL, 'world')" diff --git a/tests/test_copy_async.py b/tests/test_copy_async.py index 46f905df3..3b0008dde 100644 --- a/tests/test_copy_async.py +++ b/tests/test_copy_async.py @@ -24,7 +24,7 @@ from .test_copy import py_to_raw pytestmark = [ pytest.mark.asyncio, - pytest.mark.crdb("skip", reason="copy"), + pytest.mark.crdb_skip("copy"), ] diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 374dde452..797a539fa 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -603,7 +603,7 @@ def test_stream_no_row(conn): assert recs == [] -@pytest.mark.crdb("skip", reason="no col query") +@pytest.mark.crdb_skip("no col query") def test_stream_no_col(conn): cur = conn.cursor() recs = list(cur.stream("select")) @@ -781,7 +781,7 @@ class TestColumn: unpickled = pickle.loads(pickled) assert [tuple(d) for d in description] == [tuple(d) for d in unpickled] - @pytest.mark.crdb("skip", reason="no col query") + @pytest.mark.crdb_skip("no col query") def test_no_col_query(self, conn): cur = conn.execute("select") assert cur.description == [] diff --git a/tests/test_cursor_async.py b/tests/test_cursor_async.py index 8d11c9e98..0af43daca 100644 --- a/tests/test_cursor_async.py +++ b/tests/test_cursor_async.py @@ -595,7 +595,7 @@ async def test_stream_no_row(aconn): assert recs == [] -@pytest.mark.crdb("skip", reason="no col query") +@pytest.mark.crdb_skip("no col query") async def test_stream_no_col(aconn): cur = aconn.cursor() recs = [rec async for rec in cur.stream("select")] diff --git a/tests/test_errors.py b/tests/test_errors.py index 1d8b78c75..3aced3cd0 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -73,7 +73,7 @@ def test_diag_attr_values(conn): assert diag.severity_nonlocalized == "ERROR" -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") @pytest.mark.parametrize("enc", ["utf8", "latin9"]) def test_diag_encoding(conn, enc): msgs = [] @@ -85,7 +85,7 @@ def test_diag_encoding(conn, enc): assert msgs == [f"hello {eur}"] -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") @pytest.mark.parametrize("enc", ["utf8", "latin9"]) def test_error_encoding(conn, enc): with conn.transaction(): @@ -198,7 +198,7 @@ def test_diag_independent(conn): assert exc2.value.diag.sqlstate == "42P01" -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") def test_diag_from_commit(conn): cur = conn.cursor() cur.execute( @@ -217,7 +217,7 @@ def test_diag_from_commit(conn): @pytest.mark.asyncio -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") async def test_diag_from_commit_async(aconn): cur = aconn.cursor() await cur.execute( @@ -248,7 +248,7 @@ def test_query_context(conn): assert not s.endswith("\n") -@pytest.mark.crdb("skip", reason="do") +@pytest.mark.crdb_skip("do") def test_unknown_sqlstate(conn): code = "PXX99" with pytest.raises(KeyError): diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index ea11367ff..c508bc64c 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -266,7 +266,7 @@ def test_errors_raised_on_nested_transaction_exit(conn): assert cur2.fetchone() == (2,) -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") def test_error_on_commit(conn): conn.execute( """ diff --git a/tests/test_pipeline_async.py b/tests/test_pipeline_async.py index 8b67abd1e..57343b1a5 100644 --- a/tests/test_pipeline_async.py +++ b/tests/test_pipeline_async.py @@ -267,7 +267,7 @@ async def test_errors_raised_on_nested_transaction_exit(aconn): assert await cur2.fetchone() == (2,) -@pytest.mark.crdb("skip", reason="deferrable") +@pytest.mark.crdb_skip("deferrable") async def test_error_on_commit(aconn): await aconn.execute( """ diff --git a/tests/test_prepared.py b/tests/test_prepared.py index d7b4c7c1e..56c580a9f 100644 --- a/tests/test_prepared.py +++ b/tests/test_prepared.py @@ -113,9 +113,7 @@ def test_no_prepare_error(conn): "query", [ "create table test_no_prepare ()", - pytest.param( - "notify foo, 'bar'", marks=pytest.mark.crdb("skip", reason="notify") - ), + pytest.param("notify foo, 'bar'", marks=pytest.mark.crdb_skip("notify")), "set timezone = utc", "select num from prepared_test", "insert into prepared_test (num) values (1)", diff --git a/tests/test_prepared_async.py b/tests/test_prepared_async.py index cab7cd94d..84d948f65 100644 --- a/tests/test_prepared_async.py +++ b/tests/test_prepared_async.py @@ -105,9 +105,7 @@ async def test_no_prepare_error(aconn): "query", [ "create table test_no_prepare ()", - pytest.param( - "notify foo, 'bar'", marks=pytest.mark.crdb("skip", reason="notify") - ), + pytest.param("notify foo, 'bar'", marks=pytest.mark.crdb_skip("notify")), "set timezone = utc", "select num from prepared_test", "insert into prepared_test (num) values (1)", diff --git a/tests/test_rows.py b/tests/test_rows.py index 872c0be5d..62b15a764 100644 --- a/tests/test_rows.py +++ b/tests/test_rows.py @@ -103,7 +103,7 @@ def test_no_result(factory, conn): cur.fetchone() -@pytest.mark.crdb("skip", reason="no col query") +@pytest.mark.crdb_skip("no col query") @pytest.mark.parametrize( "factory", "tuple_row dict_row namedtuple_row args_row".split() ) diff --git a/tests/test_server_cursor.py b/tests/test_server_cursor.py index ca8fd59b8..97a5b1e47 100644 --- a/tests/test_server_cursor.py +++ b/tests/test_server_cursor.py @@ -4,7 +4,7 @@ import psycopg from psycopg import rows, errors as e from psycopg.pq import Format -pytestmark = pytest.mark.crdb("skip", reason="server-side cursor") +pytestmark = pytest.mark.crdb_skip("server-side cursor") def test_init_row_factory(conn): diff --git a/tests/test_server_cursor_async.py b/tests/test_server_cursor_async.py index e74c15a8b..83c370826 100644 --- a/tests/test_server_cursor_async.py +++ b/tests/test_server_cursor_async.py @@ -6,7 +6,7 @@ from psycopg.pq import Format pytestmark = [ pytest.mark.asyncio, - pytest.mark.crdb("skip", reason="server-side cursor"), + pytest.mark.crdb_skip("server-side cursor"), ] diff --git a/tests/test_sql.py b/tests/test_sql.py index 0f3cb23be..42b6c63ce 100644 --- a/tests/test_sql.py +++ b/tests/test_sql.py @@ -209,7 +209,7 @@ class TestSqlFormat: cur.execute("select * from test_compose") assert cur.fetchall() == [(10, "a", "b", "c"), (20, "d", "e", "f")] - @pytest.mark.crdb("skip", reason="copy") + @pytest.mark.crdb_skip("copy") def test_copy(self, conn): cur = conn.cursor() cur.execute( @@ -363,7 +363,7 @@ class TestLiteral: conn.adapters.register_dumper(str, StrDumper) assert sql.Literal("foo").as_string(conn) == "'foo'" - @pytest.mark.crdb("skip", reason="composite") # create type, actually + @pytest.mark.crdb_skip("composite") # create type, actually @pytest.mark.parametrize("name", ["a-b", f"{eur}", "order", "foo bar"]) def test_invalid_name(self, conn, name): conn.execute( diff --git a/tests/test_tpc.py b/tests/test_tpc.py index fad02a8b1..91a04e067 100644 --- a/tests/test_tpc.py +++ b/tests/test_tpc.py @@ -3,7 +3,7 @@ import pytest import psycopg from psycopg.pq import TransactionStatus -pytestmark = pytest.mark.crdb("skip", reason="2-phase commit") +pytestmark = pytest.mark.crdb_skip("2-phase commit") def test_tpc_disabled(conn, pipeline): diff --git a/tests/test_tpc_async.py b/tests/test_tpc_async.py index fd31ee033..a409a2e82 100644 --- a/tests/test_tpc_async.py +++ b/tests/test_tpc_async.py @@ -5,7 +5,7 @@ from psycopg.pq import TransactionStatus pytestmark = [ pytest.mark.asyncio, - pytest.mark.crdb("skip", reason="2-phase commit"), + pytest.mark.crdb_skip("2-phase commit"), ] diff --git a/tests/test_transaction.py b/tests/test_transaction.py index 9cb962c3b..9391e00cf 100644 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -148,7 +148,7 @@ def test_rollback_on_exception_exit(conn): assert not inserted(conn) -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") def test_context_inerror_rollback_no_clobber(conn_cls, conn, pipeline, dsn, caplog): if pipeline: # Only 'conn' is possibly in pipeline mode, but the transaction and @@ -172,7 +172,7 @@ def test_context_inerror_rollback_no_clobber(conn_cls, conn, pipeline, dsn, capl assert "in rollback" in rec.message -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") def test_context_active_rollback_no_clobber(conn_cls, dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") diff --git a/tests/test_transaction_async.py b/tests/test_transaction_async.py index 6739d8b73..55e1c9c79 100644 --- a/tests/test_transaction_async.py +++ b/tests/test_transaction_async.py @@ -85,7 +85,7 @@ async def test_rollback_on_exception_exit(aconn): assert not await inserted(aconn) -@pytest.mark.crdb("skip", reason="pg_terminate_backend") +@pytest.mark.crdb_skip("pg_terminate_backend") async def test_context_inerror_rollback_no_clobber( aconn_cls, aconn, apipeline, dsn, caplog ): @@ -111,7 +111,7 @@ async def test_context_inerror_rollback_no_clobber( assert "in rollback" in rec.message -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") async def test_context_active_rollback_no_clobber(aconn_cls, dsn, caplog): caplog.set_level(logging.WARNING, logger="psycopg") diff --git a/tests/test_typeinfo.py b/tests/test_typeinfo.py index 544e49f98..d0e57e665 100644 --- a/tests/test_typeinfo.py +++ b/tests/test_typeinfo.py @@ -72,7 +72,7 @@ async def test_fetch_not_found_async(aconn, name, status): assert info is None -@pytest.mark.crdb("skip", reason="composite") +@pytest.mark.crdb_skip("composite") @pytest.mark.parametrize( "name", ["testschema.testtype", sql.Identifier("testschema", "testtype")] ) diff --git a/tests/types/test_array.py b/tests/types/test_array.py index e27f5bdfb..41756c879 100644 --- a/tests/types/test_array.py +++ b/tests/types/test_array.py @@ -35,7 +35,7 @@ def test_dump_empty_list(conn, fmt_in, type): assert cur.fetchone()[0] -@pytest.mark.crdb("skip", reason="nested array") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("fmt_in", PyFormat) @pytest.mark.parametrize("obj, want", tests_str) def test_dump_list_str(conn, obj, want, fmt_in): @@ -51,7 +51,7 @@ def test_load_empty_list_str(conn, fmt_out): assert cur.fetchone()[0] == [] -@pytest.mark.crdb("skip", reason="nested array") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("want, obj", tests_str) def test_load_list_str(conn, obj, want, fmt_out): @@ -86,7 +86,7 @@ tests_int = [ ] -@pytest.mark.crdb("skip", reason="nested array") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("obj, want", tests_int) def test_dump_list_int(conn, obj, want): cur = conn.cursor() @@ -110,7 +110,7 @@ def test_bad_binary_array(input): tx.get_dumper(input, PyFormat.BINARY).dump(input) -@pytest.mark.crdb("skip", reason="nested array") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("want, obj", tests_int) def test_load_list_int(conn, obj, want, fmt_out): @@ -128,7 +128,7 @@ def test_load_list_int(conn, obj, want, fmt_out): assert got == want -@pytest.mark.crdb("skip", reason="composite") +@pytest.mark.crdb_skip("composite") def test_array_register(conn): conn.execute("create table mytype (data text)") cur = conn.execute("""select '(foo)'::mytype, '{"(foo)"}'::mytype[]""") @@ -253,7 +253,7 @@ def test_empty_list_after_choice(conn, fmt_in): assert cur.fetchall() == [([1.0],), ([],)] -@pytest.mark.crdb("skip", reason="geometric types") +@pytest.mark.crdb_skip("geometric types") def test_dump_list_no_comma_separator(conn): class Box: def __init__(self, x1, y1, x2, y2): @@ -280,14 +280,14 @@ def test_dump_list_no_comma_separator(conn): assert got == "{(3,4),(1,2);(5,4),(3,2)}" -@pytest.mark.crdb("skip", reason="geometric types") +@pytest.mark.crdb_skip("geometric types") def test_load_array_no_comma_separator(conn): cur = conn.execute("select '{(2,2),(1,1);(5,6),(3,4)}'::box[]") # Not parsed at the moment, but split ok on ; separator assert cur.fetchone()[0] == ["(2,2),(1,1)", "(5,6),(3,4)"] -@pytest.mark.crdb("skip", reason="array with bounds") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize( "obj, want", @@ -301,7 +301,7 @@ def test_array_with_bounds(conn, obj, want, fmt_out): assert got == want -@pytest.mark.crdb("skip", reason="array with bounds") +@pytest.mark.crdb_skip("nested array") @pytest.mark.parametrize("fmt_out", pq.Format) def test_all_chars_with_bounds(conn, fmt_out): cur = conn.cursor(binary=fmt_out) diff --git a/tests/types/test_composite.py b/tests/types/test_composite.py index 8e05f7717..5a0f437e7 100644 --- a/tests/types/test_composite.py +++ b/tests/types/test_composite.py @@ -11,7 +11,7 @@ from ..utils import eur from ..fix_crdb import is_crdb, crdb_skip_message -pytestmark = pytest.mark.crdb("skip", reason="composite") +pytestmark = pytest.mark.crdb_skip("composite") tests_str = [ ("", ()), diff --git a/tests/types/test_datetime.py b/tests/types/test_datetime.py index 597c55c24..babe9ef14 100644 --- a/tests/types/test_datetime.py +++ b/tests/types/test_datetime.py @@ -421,7 +421,7 @@ class TestDateTimeTz: assert rec[0] is True, type assert rec[1] == val - @pytest.mark.crdb("skip", reason="copy") + @pytest.mark.crdb_skip("copy") def test_load_copy(self, conn): cur = conn.cursor(binary=False) with cur.copy( @@ -615,7 +615,7 @@ class TestTimeTz: assert rec[0] is True, type assert rec[1] == val - @pytest.mark.crdb("skip", reason="copy") + @pytest.mark.crdb_skip("copy") def test_load_copy(self, conn): cur = conn.cursor(binary=False) with cur.copy( @@ -719,7 +719,7 @@ class TestInterval: with pytest.raises(DataError): cur.fetchone()[0] - @pytest.mark.crdb("skip", reason="copy") + @pytest.mark.crdb_skip("copy") def test_load_copy(self, conn): cur = conn.cursor(binary=False) with cur.copy( diff --git a/tests/types/test_enum.py b/tests/types/test_enum.py index e5b15d132..8dfb6d4f0 100644 --- a/tests/types/test_enum.py +++ b/tests/types/test_enum.py @@ -118,7 +118,7 @@ def test_enum_loader_nonascii(conn, encoding, fmt_in, fmt_out): assert cur.fetchone()[0] == enum[label] -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("enum", enum_cases) @pytest.mark.parametrize("fmt_in", PyFormat) @pytest.mark.parametrize("fmt_out", pq.Format) @@ -161,7 +161,7 @@ def test_enum_dumper_nonascii(conn, encoding, fmt_in, fmt_out): assert cur.fetchone()[0] == item -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("enum", enum_cases) @pytest.mark.parametrize("fmt_in", PyFormat) @pytest.mark.parametrize("fmt_out", pq.Format) diff --git a/tests/types/test_hstore.py b/tests/types/test_hstore.py index df67d17e5..5142d58ce 100644 --- a/tests/types/test_hstore.py +++ b/tests/types/test_hstore.py @@ -4,7 +4,7 @@ import psycopg from psycopg.types import TypeInfo from psycopg.types.hstore import HstoreLoader, register_hstore -pytestmark = pytest.mark.crdb("skip", reason="hstore") +pytestmark = pytest.mark.crdb_skip("hstore") @pytest.mark.parametrize( diff --git a/tests/types/test_json.py b/tests/types/test_json.py index 9e707e93f..50e8ce32f 100644 --- a/tests/types/test_json.py +++ b/tests/types/test_json.py @@ -47,7 +47,7 @@ def test_dump(conn, val, wrapper, fmt_in): assert cur.fetchone()[0] is True -@pytest.mark.crdb("skip", reason="json array") +@pytest.mark.crdb_skip("json array") @pytest.mark.parametrize("val", samples) @pytest.mark.parametrize("wrapper", ["Json", "Jsonb"]) @pytest.mark.parametrize("fmt_in", PyFormat) @@ -71,7 +71,7 @@ def test_load(conn, val, jtype, fmt_out): assert cur.fetchone()[0] == json.loads(val) -@pytest.mark.crdb("skip", reason="json array") +@pytest.mark.crdb_skip("json array") @pytest.mark.parametrize("val", samples) @pytest.mark.parametrize("jtype", ["json", "jsonb"]) @pytest.mark.parametrize("fmt_out", pq.Format) @@ -81,7 +81,7 @@ def test_load_array(conn, val, jtype, fmt_out): assert cur.fetchone()[0] == [json.loads(val)] -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("val", samples) @pytest.mark.parametrize("jtype", ["json", "jsonb"]) @pytest.mark.parametrize("fmt_out", pq.Format) diff --git a/tests/types/test_multirange.py b/tests/types/test_multirange.py index 4e5ac9870..2ab51524e 100644 --- a/tests/types/test_multirange.py +++ b/tests/types/test_multirange.py @@ -17,7 +17,7 @@ from .test_range import create_test_range pytestmark = [ pytest.mark.pg(">= 14"), - pytest.mark.crdb("skip", reason="range"), + pytest.mark.crdb_skip("range"), ] diff --git a/tests/types/test_net.py b/tests/types/test_net.py index 252e0065d..8739398f3 100644 --- a/tests/types/test_net.py +++ b/tests/types/test_net.py @@ -6,7 +6,7 @@ from psycopg import pq from psycopg import sql from psycopg.adapt import PyFormat -crdb_skip_cidr = pytest.mark.crdb("skip", reason="cidr") +crdb_skip_cidr = pytest.mark.crdb_skip("cidr") @pytest.mark.parametrize("fmt_in", PyFormat) @@ -66,7 +66,7 @@ def test_network_mixed_size_array(conn, fmt_in): assert val == got -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("val", ["127.0.0.1/32", "::ffff:102:300/128"]) def test_inet_load_address(conn, fmt_out, val): @@ -89,7 +89,7 @@ def test_inet_load_address(conn, fmt_out, val): assert got == addr -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("val", ["127.0.0.1/24", "::ffff:102:300/127"]) def test_inet_load_network(conn, fmt_out, val): diff --git a/tests/types/test_numeric.py b/tests/types/test_numeric.py index b2222eabf..cc471e8c7 100644 --- a/tests/types/test_numeric.py +++ b/tests/types/test_numeric.py @@ -301,7 +301,7 @@ def test_load_float_approx(conn, expr, pgtype, want, fmt_out): assert result == pytest.approx(want) -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") def test_load_float_copy(conn): cur = conn.cursor(binary=False) with cur.copy("copy (select 3.14::float8, 'hi'::text) to stdout;") as copy: @@ -369,7 +369,7 @@ def test_quote_numeric(conn, val, expr): assert r == (val, -val) -@pytest.mark.crdb("skip", reason="numeric precision not maintained? TODOCRDB") +@pytest.mark.crdb_skip("binary decimal") @pytest.mark.parametrize( "expr", ["NaN", "1", "1.0", "-1", "0.0", "0.01", "11", "1.1", "1.01", "0", "0.00"] @@ -404,7 +404,7 @@ def test_dump_numeric_binary(conn, expr): [ f if f != PyFormat.BINARY - else pytest.param(f, marks=pytest.mark.crdb("skip", reason="binary decimal")) + else pytest.param(f, marks=pytest.mark.crdb_skip("binary decimal")) for f in PyFormat ], ) diff --git a/tests/types/test_range.py b/tests/types/test_range.py index 78e99c1d2..1efd398bb 100644 --- a/tests/types/test_range.py +++ b/tests/types/test_range.py @@ -13,7 +13,7 @@ from psycopg.types.range import Range, RangeInfo, register_range from ..utils import eur from ..fix_crdb import is_crdb, crdb_skip_message -pytestmark = pytest.mark.crdb("skip", reason="range") +pytestmark = pytest.mark.crdb_skip("range") type2sub = { "int4range": "int4", diff --git a/tests/types/test_string.py b/tests/types/test_string.py index be2067204..0722fcc89 100644 --- a/tests/types/test_string.py +++ b/tests/types/test_string.py @@ -108,7 +108,7 @@ def test_dump_enc(conn, fmt_in, encoding): assert res == ord(eur) -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("fmt_in", PyFormat) def test_dump_badenc(conn, fmt_in): cur = conn.cursor() @@ -157,7 +157,7 @@ def test_dump_text_oid(conn, fmt_in): assert cur.fetchone()[0] == "foobar" -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("encoding", ["utf8", crdb_encoding("latin9")]) @pytest.mark.parametrize("typename", ["text", "varchar", "name", "bpchar"]) @@ -178,7 +178,7 @@ def test_load_enc(conn, typename, encoding, fmt_out): assert res == eur -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("typename", ["text", "varchar", "name", "bpchar"]) def test_load_badenc(conn, typename, fmt_out): @@ -198,7 +198,7 @@ def test_load_badenc(conn, typename, fmt_out): copy.read_row() -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("fmt_out", pq.Format) @pytest.mark.parametrize("typename", ["text", "varchar", "name", "bpchar"]) def test_load_ascii(conn, typename, fmt_out): @@ -229,7 +229,7 @@ def test_text_array(conn, typename, fmt_in, fmt_out): assert res == a -@pytest.mark.crdb("skip", reason="encoding") +@pytest.mark.crdb_skip("encoding") @pytest.mark.parametrize("fmt_in", PyFormat) @pytest.mark.parametrize("fmt_out", pq.Format) def test_text_array_ascii(conn, fmt_in, fmt_out): diff --git a/tests/types/test_uuid.py b/tests/types/test_uuid.py index 14f8715b0..f86f06665 100644 --- a/tests/types/test_uuid.py +++ b/tests/types/test_uuid.py @@ -17,7 +17,7 @@ def test_uuid_dump(conn, fmt_in): assert cur.fetchone()[0] is True -@pytest.mark.crdb("skip", reason="copy") +@pytest.mark.crdb_skip("copy") @pytest.mark.parametrize("fmt_out", pq.Format) def test_uuid_load(conn, fmt_out): cur = conn.cursor(binary=fmt_out)