From: Jacopo Farina Date: Wed, 15 Sep 2021 14:28:35 +0000 (+0200) Subject: Force different placeholder to increase the coverage X-Git-Tag: 3.0~71^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=476320590bd6ab6c472fa1190b74b301bf670816;p=thirdparty%2Fpsycopg.git Force different placeholder to increase the coverage --- diff --git a/tests/test_shapely.py b/tests/test_shapely.py index 6e410793e..b01d320e1 100644 --- a/tests/test_shapely.py +++ b/tests/test_shapely.py @@ -97,6 +97,9 @@ def test_write_read_shape(shapely_conn, fmt_out): SAMPLE_POINT = Point(1.2, 3.4) SAMPLE_POLYGON = Polygon([(0, 0), (1, 1), (1, 0)]) + + fmt_placeholder = "%b" if fmt_out == Format.BINARY else "%t" + with shapely_conn.cursor(binary=fmt_out) as cur: cur.execute( """ @@ -107,10 +110,11 @@ def test_write_read_shape(shapely_conn, fmt_out): """ ) cur.execute( - "insert into sample_geoms(id, geom) VALUES(1, %s)", (SAMPLE_POINT,) + f"insert into sample_geoms(id, geom) VALUES(1, {fmt_placeholder})", + (SAMPLE_POINT,), ) cur.execute( - "insert into sample_geoms(id, geom) VALUES(2, %s)", + f"insert into sample_geoms(id, geom) VALUES(2, {fmt_placeholder})", (SAMPLE_POLYGON,), )