test: replace raw execute() with fixture code where possible

This commit is contained in:
Sarah Hoffmann
2021-05-19 12:11:04 +02:00
parent 65bd749918
commit c06a1d007a
15 changed files with 128 additions and 186 deletions

View File

@@ -19,7 +19,7 @@ import nominatim.tokenizer.factory
import dummy_tokenizer
import mocks
from cursor import TestingCursor
from cursor import CursorForTesting
@pytest.fixture
@@ -80,7 +80,7 @@ def temp_db_cursor(temp_db):
"""
conn = psycopg2.connect('dbname=' + temp_db)
conn.set_isolation_level(0)
with conn.cursor(cursor_factory=TestingCursor) as cur:
with conn.cursor(cursor_factory=CursorForTesting) as cur:
yield cur
conn.close()