@@ -305,6 +305,46 @@ def test_results_checksum(self):
305305
306306 self .assertEqual (cursor ._checksum .checksum .digest (), checksum .digest ())
307307
308+ def test_execute_many (self ):
309+ # connect to the test database
310+ conn = Connection (Config .INSTANCE , self ._db )
311+ cursor = conn .cursor ()
312+
313+ cursor .execute (
314+ """
315+ INSERT INTO contacts (contact_id, first_name, last_name, email)
316+ VALUES (1, 'first-name', 'last-name', 'test.email@example.com'),
317+ (2, 'first-name2', 'last-name2', 'test.email2@example.com')
318+ """
319+ )
320+ conn .commit ()
321+
322+ cursor .executemany (
323+ """
324+ SELECT * FROM contacts WHERE contact_id = @a1
325+ """ ,
326+ ({"a1" : 1 }, {"a1" : 2 }),
327+ )
328+ res = cursor .fetchall ()
329+ conn .commit ()
330+
331+ self .assertEqual (len (res ), 2 )
332+ self .assertEqual (res [0 ][0 ], 1 )
333+ self .assertEqual (res [1 ][0 ], 2 )
334+
335+ # checking that execute() and executemany()
336+ # results are not mixed together
337+ cursor .execute (
338+ """
339+ SELECT * FROM contacts WHERE contact_id = 1
340+ """ ,
341+ )
342+ res = cursor .fetchone ()
343+ conn .commit ()
344+
345+ self .assertEqual (res [0 ], 1 )
346+ conn .close ()
347+
308348
309349def clear_table (transaction ):
310350 """Clear the test table."""
0 commit comments