Skip to content

Commit 87fd98c

Browse files
committed
test case addition
1 parent 878c7bb commit 87fd98c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_004_cursor.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,21 @@ def test_executemany_empty_parameter_list(cursor, db_connection):
16621662
cursor.execute("DROP TABLE IF EXISTS #pytest_empty_params")
16631663
db_connection.commit()
16641664

1665+
def test_executemany_NONE_parameter_list(cursor, db_connection):
1666+
"""Test executemany with an NONE parameter list."""
1667+
try:
1668+
cursor.execute("CREATE TABLE #pytest_empty_params (val VARCHAR(50))")
1669+
data = [(None,), (None,)]
1670+
cursor.executemany("INSERT INTO #pytest_empty_params VALUES (?)", data)
1671+
db_connection.commit()
1672+
1673+
cursor.execute("SELECT COUNT(*) FROM #pytest_empty_params")
1674+
count = cursor.fetchone()[0]
1675+
assert count == 2
1676+
finally:
1677+
cursor.execute("DROP TABLE IF EXISTS #pytest_empty_params")
1678+
db_connection.commit()
1679+
16651680

16661681
def test_executemany_Decimal_list(cursor, db_connection):
16671682
"""Test executemany with an decimal parameter list."""

0 commit comments

Comments
 (0)