]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test(crdb): skip tests for unsupported types
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 23 May 2022 00:42:15 +0000 (02:42 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
tests/types/test_composite.py
tests/types/test_hstore.py
tests/types/test_multirange.py
tests/types/test_net.py
tests/types/test_range.py
tests/types/test_shapely.py
tests/types/test_uuid.py

index 1ca4a6220fa08119e3cbef6ed26e2791f5cd58a4..8e05f771799167db9c29ab69740d8c15c30bfab2 100644 (file)
@@ -8,6 +8,10 @@ from psycopg.types.composite import CompositeInfo, register_composite
 from psycopg.types.composite import TupleDumper, TupleBinaryDumper
 
 from ..utils import eur
+from ..fix_crdb import is_crdb, crdb_skip_message
+
+
+pytestmark = pytest.mark.crdb("skip", reason="composite")
 
 tests_str = [
     ("", ()),
@@ -112,6 +116,8 @@ def test_load_record_binary(conn, want, rec):
 
 @pytest.fixture(scope="session")
 def testcomp(svcconn):
+    if is_crdb(svcconn):
+        pytest.skip(crdb_skip_message("composite"))
     cur = svcconn.cursor()
     cur.execute(
         """
index ac9d87c2466df783b08e3dcef27ae20aacc93969..1eac009ff2216b05c32c55135a9dba1a17cedd7f 100644 (file)
@@ -4,6 +4,8 @@ import psycopg
 from psycopg.types import TypeInfo
 from psycopg.types.hstore import HstoreLoader, register_hstore
 
+pytestmark = pytest.mark.crdb("skip", reason="hstore")
+
 
 @pytest.mark.parametrize(
     "s, d",
index 5dd9b0990cc3a2d4fbae2d60dca6f65700a1d3dc..4e5ac98700c6ebc9bffde106d298f5f1a36c336a 100644 (file)
@@ -15,7 +15,10 @@ from psycopg.types.multirange import register_multirange
 from ..utils import eur
 from .test_range import create_test_range
 
-pytestmark = pytest.mark.pg(">= 14")
+pytestmark = [
+    pytest.mark.pg(">= 14"),
+    pytest.mark.crdb("skip", reason="range"),
+]
 
 
 class TestMultirangeObject:
index c1b29d7f98e68e2c473d643e548de41f8219fb8b..252e0065d0fff509a16abad41b118764f524e994 100644 (file)
@@ -6,6 +6,8 @@ from psycopg import pq
 from psycopg import sql
 from psycopg.adapt import PyFormat
 
+crdb_skip_cidr = pytest.mark.crdb("skip", reason="cidr")
+
 
 @pytest.mark.parametrize("fmt_in", PyFormat)
 @pytest.mark.parametrize("val", ["192.168.0.1", "2001:db8::"])
@@ -37,6 +39,7 @@ def test_interface_dump(conn, fmt_in, val):
     assert cur.fetchone()[0] is True
 
 
+@crdb_skip_cidr
 @pytest.mark.parametrize("fmt_in", PyFormat)
 @pytest.mark.parametrize("val", ["127.0.0.0/24", "::ffff:102:300/128"])
 def test_network_dump(conn, fmt_in, val):
@@ -50,6 +53,7 @@ def test_network_dump(conn, fmt_in, val):
     assert cur.fetchone()[0] is True
 
 
+@crdb_skip_cidr
 @pytest.mark.parametrize("fmt_in", PyFormat)
 def test_network_mixed_size_array(conn, fmt_in):
     val = [
@@ -62,6 +66,7 @@ def test_network_mixed_size_array(conn, fmt_in):
     assert val == got
 
 
+@pytest.mark.crdb("skip", reason="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):
@@ -84,6 +89,7 @@ def test_inet_load_address(conn, fmt_out, val):
     assert got == addr
 
 
+@pytest.mark.crdb("skip", reason="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):
@@ -106,6 +112,7 @@ def test_inet_load_network(conn, fmt_out, val):
     assert got == pyval
 
 
+@crdb_skip_cidr
 @pytest.mark.parametrize("fmt_out", pq.Format)
 @pytest.mark.parametrize("val", ["127.0.0.0/24", "::ffff:102:300/128"])
 def test_cidr_load(conn, fmt_out, val):
index 6ab76280acda9286a10c854f8fb9c855e2d197fd..78e99c1d2a35d4307a97085906fb696ccc55f98b 100644 (file)
@@ -11,6 +11,9 @@ from psycopg.types import range as range_module
 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")
 
 type2sub = {
     "int4range": "int4",
@@ -263,6 +266,9 @@ def testrange(svcconn):
 
 
 def create_test_range(conn):
+    if is_crdb(conn):
+        pytest.skip(crdb_skip_message("range"))
+
     conn.execute(
         """
         create schema if not exists testschema;
index a460c483d473ba31c8e3d49d7988e5ee7466c855..0f7007e2dc40209c570ac149df2f3948448b6350 100644 (file)
@@ -10,7 +10,10 @@ pytest.importorskip("shapely")
 from shapely.geometry import Point, Polygon, MultiPolygon  # noqa: E402
 from psycopg.types.shapely import register_shapely  # noqa: E402
 
-pytestmark = [pytest.mark.postgis]
+pytestmark = [
+    pytest.mark.postgis,
+    pytest.mark.crdb("skip"),
+]
 
 # real example, with CRS and "holes"
 MULTIPOLYGON_GEOJSON = """
index f79b0060dddd3875d704ed82710b4d5b920d507e..14f8715b03b154edbf0941fd11d25171e26a9aa0 100644 (file)
@@ -17,6 +17,7 @@ def test_uuid_dump(conn, fmt_in):
     assert cur.fetchone()[0] is True
 
 
+@pytest.mark.crdb("skip", reason="copy")
 @pytest.mark.parametrize("fmt_out", pq.Format)
 def test_uuid_load(conn, fmt_out):
     cur = conn.cursor(binary=fmt_out)