]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Binary copy tests enabled: now there is an int binary dumper
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 15 Nov 2020 02:32:11 +0000 (02:32 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 15 Nov 2020 02:35:05 +0000 (02:35 +0000)
tests/test_copy.py
tests/test_copy_async.py

index 1d342b84fd344525a87de80df6a64d5267722eda..49caca46a8cfbc28e3c05aaf807431f028efa784 100644 (file)
@@ -3,10 +3,11 @@ import pytest
 from psycopg3 import pq
 from psycopg3 import errors as e
 from psycopg3.adapt import Format
+from psycopg3.types.numeric import Int4
 
 eur = "\u20ac"
 
-sample_records = [(10, 20, "hello"), (40, None, "world")]
+sample_records = [(Int4(10), Int4(20), "hello"), (Int4(40), None, "world")]
 
 sample_values = "values (10::int, 20::int, 'hello'::text), (40, NULL, 'world')"
 
@@ -169,9 +170,6 @@ def test_copy_in_buffers_with_py_error(conn):
 
 @pytest.mark.parametrize("format", [Format.TEXT, Format.BINARY])
 def test_copy_in_records(conn, format):
-    if format == Format.BINARY:
-        pytest.skip("TODO: implement int binary adapter")
-
     cur = conn.cursor()
     ensure_table(cur, sample_tabledef)
 
@@ -185,9 +183,6 @@ def test_copy_in_records(conn, format):
 
 @pytest.mark.parametrize("format", [Format.TEXT, Format.BINARY])
 def test_copy_in_records_binary(conn, format):
-    if format == Format.TEXT:
-        pytest.skip("TODO: remove after implementing int binary adapter")
-
     cur = conn.cursor()
     ensure_table(cur, "col1 serial primary key, col2 int, data text")
 
index 8cc0e05aed037a4b6b92a79d1b9286ce43b040d6..2a471999b8218c0fd79b17ef84b9170c30c12f17 100644 (file)
@@ -139,9 +139,6 @@ async def test_copy_in_buffers_with_py_error(aconn):
 
 @pytest.mark.parametrize("format", [Format.TEXT, Format.BINARY])
 async def test_copy_in_records(aconn, format):
-    if format == Format.BINARY:
-        pytest.skip("TODO: implement int binary adapter")
-
     cur = await aconn.cursor()
     await ensure_table(cur, sample_tabledef)
 
@@ -158,9 +155,6 @@ async def test_copy_in_records(aconn, format):
 
 @pytest.mark.parametrize("format", [Format.TEXT, Format.BINARY])
 async def test_copy_in_records_binary(aconn, format):
-    if format == Format.TEXT:
-        pytest.skip("TODO: remove after implementing int binary adapter")
-
     cur = await aconn.cursor()
     await ensure_table(cur, "col1 serial primary key, col2 int, data text")