Skip to content

Commit 2e638a0

Browse files
Harden test_rowcount_prefixed_with_comment test
Make sure a different rowcount is returned for each query
1 parent 7d7a654 commit 2e638a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_sqlite3/test_dbapi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -934,17 +934,17 @@ def test_rowcount_prefixed_with_comment(self):
934934
# gh-79579: rowcount is updated even if query is prefixed with comments
935935
self.cu.execute("""
936936
-- foo
937-
insert into test(name) values ('foo')
937+
insert into test(name) values ('foo'), ('foo')
938938
""")
939-
self.assertEqual(self.cu.rowcount, 1)
939+
self.assertEqual(self.cu.rowcount, 2)
940940
self.cu.execute("""
941941
/* -- messy *r /* /* ** *- *--
942942
*/
943943
/* one more */ insert into test(name) values ('messy')
944944
""")
945945
self.assertEqual(self.cu.rowcount, 1)
946946
self.cu.execute("/* bar */ update test set name='bar' where name='foo'")
947-
self.assertEqual(self.cu.rowcount, 2)
947+
self.assertEqual(self.cu.rowcount, 3)
948948

949949
def test_rowcount_vaccuum(self):
950950
data = ((1,), (2,), (3,))

0 commit comments

Comments
 (0)