Skip to content

Commit 7c5a0dd

Browse files
committed
mix data set with NONE
1 parent ce3a27d commit 7c5a0dd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_004_cursor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,22 @@ def test_executemany_NONE_parameter_list(cursor, db_connection):
16781678
db_connection.commit()
16791679

16801680

1681+
def test_executemany_MIX_NONE_parameter_list(cursor, db_connection):
1682+
"""Test executemany with an NONE parameter list."""
1683+
try:
1684+
cursor.execute("CREATE TABLE #pytest_empty_params (val VARCHAR(50))")
1685+
data = [(None,), ('Test',),(None,)]
1686+
cursor.executemany("INSERT INTO #pytest_empty_params VALUES (?)", data)
1687+
db_connection.commit()
1688+
1689+
cursor.execute("SELECT COUNT(*) FROM #pytest_empty_params")
1690+
count = cursor.fetchone()[0]
1691+
assert count == 3
1692+
finally:
1693+
cursor.execute("DROP TABLE IF EXISTS #pytest_empty_params")
1694+
db_connection.commit()
1695+
1696+
16811697
def test_executemany_Decimal_list(cursor, db_connection):
16821698
"""Test executemany with an decimal parameter list."""
16831699
try:

0 commit comments

Comments
 (0)