psycopg.git / summary / log / commit / refs
commit 021c54c9b5aaecd343e2d1301ac17cea9568a299
Author: Jacopo Farina <jacopo.farina@flixbus.com>
Commit: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: Thu Sep 16 12:45:48 2021 +0000
Pass test geoJSON as parameter, not with string interpolation
tests/test_shapely.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test_shapely.py b/tests/test_shapely.py
index 8f776044..e8f10a57 100644
--- a/tests/test_shapely.py
+++ b/tests/test_shapely.py
@@ -3,7 +3,6 @@ import pytest
from psycopg.pq import Format
from psycopg.types import TypeInfo
from psycopg.adapt import PyFormat
-
from psycopg import ProgrammingError
pytestmark = [pytest.mark.postgis]
@@ -134,9 +133,10 @@ def test_match_geojson(shapely_conn, fmt_out):
SAMPLE_POINT = Point(1.2, 3.4)
with shapely_conn.cursor(binary=fmt_out) as cur:
cur.execute(
- f"""
- select ST_GeomFromGeoJSON('{SAMPLE_POINT_GEOJSON}')
"""
+ select ST_GeomFromGeoJSON(%s)
+ """,
+ (SAMPLE_POINT_GEOJSON,),
)
result = cur.fetchone()[0]
# clone the coordinates to have a list instead of a shapely wrapper
[parent: d275dcd45158]