From 63d4278af056cc9df6842e33ca7e6c74c89fdf16 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 15 Nov 2020 02:32:11 +0000 Subject: [PATCH] Binary copy tests enabled: now there is an int binary dumper --- tests/test_copy.py | 9 ++------- tests/test_copy_async.py | 6 ------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/test_copy.py b/tests/test_copy.py index 1d342b84f..49caca46a 100644 --- a/tests/test_copy.py +++ b/tests/test_copy.py @@ -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") diff --git a/tests/test_copy_async.py b/tests/test_copy_async.py index 8cc0e05ae..2a471999b 100644 --- a/tests/test_copy_async.py +++ b/tests/test_copy_async.py @@ -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") -- 2.47.2