]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(crdb): use the crdb_skip marker
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 7 Jun 2022 21:28:11 +0000 (23:28 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
Enable cancel-based tests on CRDB 22.

48 files changed:
tests/fix_crdb.py
tests/fix_psycopg.py
tests/pool/test_null_pool.py
tests/pool/test_null_pool_async.py
tests/pool/test_pool.py
tests/pool/test_pool_async.py
tests/pq/test_async.py
tests/pq/test_copy.py
tests/pq/test_exec.py
tests/pq/test_misc.py
tests/pq/test_pgconn.py
tests/test_client_cursor.py
tests/test_client_cursor_async.py
tests/test_concurrency.py
tests/test_concurrency_async.py
tests/test_connection.py
tests/test_connection_async.py
tests/test_conninfo.py
tests/test_copy.py
tests/test_copy_async.py
tests/test_cursor.py
tests/test_cursor_async.py
tests/test_errors.py
tests/test_pipeline.py
tests/test_pipeline_async.py
tests/test_prepared.py
tests/test_prepared_async.py
tests/test_rows.py
tests/test_server_cursor.py
tests/test_server_cursor_async.py
tests/test_sql.py
tests/test_tpc.py
tests/test_tpc_async.py
tests/test_transaction.py
tests/test_transaction_async.py
tests/test_typeinfo.py
tests/types/test_array.py
tests/types/test_composite.py
tests/types/test_datetime.py
tests/types/test_enum.py
tests/types/test_hstore.py
tests/types/test_json.py
tests/types/test_multirange.py
tests/types/test_net.py
tests/types/test_numeric.py
tests/types/test_range.py
tests/types/test_string.py
tests/types/test_uuid.py

index 14df5f60b06ed1139e39402b4df084dfe320e11f..ad6669dd2dc9a63c886d8242d976a99db6551e93 100644 (file)
@@ -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,
index 0c3b2960ac9522197bcb5d48149970eddd0d9ff6..80e0c626d178d2904ce89ffcad4bb9b042dc2ca1 100644 (file)
@@ -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()
index e3d64c45c793c34668538aadd78462332f0baedb..4c44d0ce7c0db48026800a06c2247f0606d93a79 100644 (file)
@@ -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 = []
 
index f88d76a94237b1bff174edacf6cd6b79e311e9b4..ca449265b6083e50540d601c3281faa91ea7b32b 100644 (file)
@@ -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] = []
 
index 22d0bfe8b38f9460103e5dbc57b3058c26a2bb42..373ff5ababc180aa87db043877f7ed7cc8f7294e 100644 (file)
@@ -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:
index b04b2566e7fabd3ebced524cb1bb1dc58a2eb58d..a541efb189fde00fe7a593d1d86fdbb52cf14814 100644 (file)
@@ -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:
index 113b548445ace178369b1ac0956ab48c9f426e0d..2c3de9814c6b2c7b89a760086b3a110762b0692f 100644 (file)
@@ -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"""
index cec848b2a5bd5a5e0a9c9c2741124412e80dd779..383d272a2c704fa4312c8c7ef5026daa1d5a1ed9 100644 (file)
@@ -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')"
 
index 3ae4eeb165350f072a3ad6394c045d7728784c77..86c30c099e905f2fb360d112446000ab74e28311 100644 (file)
@@ -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"""
index eef4d2dac95ad75afffc99c259968b918cfcd632..599758fd33ddbfe58d292a83d73204c5b565ea6a 100644 (file)
@@ -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
index 6f339617b35eb79f32cb7273d6c3c8a13f730ab6..663511a4dda260e1de01da2e54a20f8813a25dc9 100644 (file)
@@ -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()
index c2cf43e4a42e628874b7a8cfc4d5c6d318dbac7e..fd733984b84f1670f98e775a8ceaece8953dc41f 100644 (file)
@@ -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 == []
index b7317390033304820973d340292f4b63835a36cf..adcea69c61b9d028c130d50493fa8c122f5b8c80 100644 (file)
@@ -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()
index 18c7161272d604c776d27ffed50592356e0b0224..4a60bbf67b53adf8444911c3955c47c275d931da 100644 (file)
@@ -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)
index 06f660f81e23563981a496323a66becadf979770..29b08cf1b9c9d3e9e4fb8eb07631dcc9cf7aecc1 100644 (file)
@@ -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
index ff085bb1e474d6c8bf9501718a20608336f063ae..59c044694378361c2fa8ec75a5843b9282b5f76f 100644 (file)
@@ -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")),
 ]
 
 
index 5f3c832b0604910154e11f2832c8bd36b2da8ea1..c6971cae1952e5b3b0df8ceb0917626075ff159f 100644 (file)
@@ -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 = []
index a8111702e648340c8e5e71d8047571a9ca53a091..34bfa40c569fa9b7bb82bc9e7730a7911e392aca 100644 (file)
@@ -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")
index 5eb8174d818dfa5a35daf9cce2476e78d52d0d97..c02483a3bd880e0162af72b46964079778789ae0 100644 (file)
@@ -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')"
index 46f905df3ff48e0a1995cf048bc69ceac0c81b11..3b0008dde1d6a7c41ae0ee1d3c93fa251a408623 100644 (file)
@@ -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"),
 ]
 
 
index 374dde45238b4619e7edb8e828dae4a4238829c4..797a539fa3848a62afc05fe89e6cfdd3bf42b1b6 100644 (file)
@@ -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 == []
index 8d11c9e98ca075281af5cfd84c33c11ad82bce32..0af43daca90969d261a9bd5f042cb44fb1de248f 100644 (file)
@@ -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")]
index 1d8b78c750dea433066ee0f243fc310a84e53bad..3aced3cd08aa1f03f31c6c086ee40d5b98abcbba 100644 (file)
@@ -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):
index ea11367ff3fdf0edbc0e40126bc5d81934ebcf81..c508bc64c2aacc609207a61bdc5643b8d27b17f8 100644 (file)
@@ -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(
         """
index 8b67abd1e6464e508d2c755ca68457a50798497d..57343b1a5d46ed60c8621e7f346c18b6db261847 100644 (file)
@@ -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(
         """
index d7b4c7c1e6d7e0b06bc133e2bef800cf8b91d61b..56c580a9f0a8c2f937bee7e630496fe315ccfcb2 100644 (file)
@@ -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)",
index cab7cd94d216dc2ec7cea082d656462565ac1bcd..84d948f6553d7f13b7642577fa78edfe77727bb3 100644 (file)
@@ -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)",
index 872c0be5d4eecac9c0122bcc78eb81552f04ad44..62b15a764b8601812dfcde6f03aee91693b96c73 100644 (file)
@@ -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()
 )
index ca8fd59b8b67c9c5dd4fb953007c0b1061311095..97a5b1e47a5e748ac96a2dca1bf3ea209caf9ac7 100644 (file)
@@ -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):
index e74c15a8b63762ab7db64d64e58a730cd9e25dac..83c3708267fc3149e481f9ff11b1daff65c411d1 100644 (file)
@@ -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"),
 ]
 
 
index 0f3cb23be2569dd88a30e51a295286f9c249beeb..42b6c63ce5c7e7c0234eeb8509f0c505376ca3f1 100644 (file)
@@ -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(
index fad02a8b188be6b129fe4140d5f6f0be397c5751..91a04e0672befcf721d16f9fadb685ea95771fb6 100644 (file)
@@ -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):
index fd31ee033a9d7a3451ff33b41769f6888345a4a3..a409a2e82b4cb6665a6297ac8df8d5e2fec7bef4 100644 (file)
@@ -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"),
 ]
 
 
index 9cb962c3b35fce09403ad23ee577a0bfc3bcfaa6..9391e00cf2317973f085e5b6eee7915f7e2ffb3c 100644 (file)
@@ -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")
 
index 6739d8b7386b7cc71214c4e7ae00de006b996daf..55e1c9c790ff4746a7f491498626a8f26b671a36 100644 (file)
@@ -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")
 
index 544e49f98bc1708ccd42b24e5620c40629f128b5..d0e57e6652c709d9da5be3d10c63dca1a06549ad 100644 (file)
@@ -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")]
 )
index e27f5bdfbb6b637166ef564ee6217a74e7a7d8da..41756c87947fc2d5e9f2d35503b545597e989b89 100644 (file)
@@ -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)
index 8e05f771799167db9c29ab69740d8c15c30bfab2..5a0f437e75d9a147908de91b3a6d19a8db95dce0 100644 (file)
@@ -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 = [
     ("", ()),
index 597c55c24363ca6e109bc28a90aeae2cc2b380b8..babe9ef146285089aca9ad8ba216574ccaa39685 100644 (file)
@@ -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(
index e5b15d13258faefbf4f20c61bb19d0d4575e50a6..8dfb6d4f0d381f26083d677b6ebe9418e970248d 100644 (file)
@@ -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)
index df67d17e5c2e51aeb2f1ba2b7bd2120154c784d0..5142d58ce0d73eb57e015333252f8aa4fdb44217 100644 (file)
@@ -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(
index 9e707e93ff9c10c6b5204515086b89faa3cd610a..50e8ce32fde39aa5de1a178eeba6e15b178f5d53 100644 (file)
@@ -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)
index 4e5ac98700c6ebc9bffde106d298f5f1a36c336a..2ab51524e3eef0bcf50b3a86b33687694920474e 100644 (file)
@@ -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"),
 ]
 
 
index 252e0065d0fff509a16abad41b118764f524e994..8739398f376a54521ab77d8e213b1093f8e9be1c 100644 (file)
@@ -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):
index b2222eabf39435a0f82be37bc82da1d294560ad5..cc471e8c717bd3cf42ba9ab259c08450d9ce93da 100644 (file)
@@ -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
     ],
 )
index 78e99c1d2a35d4307a97085906fb696ccc55f98b..1efd398bb80dd6361ed8634da64d41db3b70b3d4 100644 (file)
@@ -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",
index be20672044321fa853d4d4eaefdd73c66aed0393..0722fcc89171c6380d367ddf9b0cd713bf726163 100644 (file)
@@ -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):
index 14f8715b03b154edbf0941fd11d25171e26a9aa0..f86f06665c2e7a1aa0f83493986d148bc3ec420d 100644 (file)
@@ -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)