Skip to content

Commit e119285

Browse files
ext/docker-tests: Fix SQL docker tests (#646)
The executemany test fails in some conditions because the argument used is a sequence and not a sequence of sequences as it should be. Fixes #589.
1 parent 090b664 commit e119285

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

ext/opentelemetry-ext-docker-tests/tests/mysql/test_mysql_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_executemany(self):
8282
"""Should create a child span for executemany
8383
"""
8484
with self._tracer.start_as_current_span("rootSpan"):
85-
data = ["1", "2", "3"]
85+
data = (("1",), ("2",), ("3",))
8686
stmt = "INSERT INTO test (id) VALUES (%s)"
8787
self._cursor.executemany(stmt, data)
8888
self.validate_spans()

ext/opentelemetry-ext-docker-tests/tests/postgres/test_psycopg_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_executemany(self):
8989
"""Should create a child span for executemany
9090
"""
9191
with self._tracer.start_as_current_span("rootSpan"):
92-
data = ("1", "2", "3")
92+
data = (("1",), ("2",), ("3",))
9393
stmt = "INSERT INTO test (id) VALUES (%s)"
9494
self._cursor.executemany(stmt, data)
9595
self.validate_spans()

ext/opentelemetry-ext-docker-tests/tests/pymysql/test_pymysql_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_executemany(self):
8181
"""Should create a child span for executemany
8282
"""
8383
with self._tracer.start_as_current_span("rootSpan"):
84-
data = ["1", "2", "3"]
84+
data = (("1",), ("2",), ("3",))
8585
stmt = "INSERT INTO test (id) VALUES (%s)"
8686
self._cursor.executemany(stmt, data)
8787
self.validate_spans()

0 commit comments

Comments
 (0)