From: Mike Bayer Date: Sun, 11 Jan 2009 23:55:35 +0000 (+0000) Subject: don't INSERT a blank row if no rows passed. (breaks all the tests for SQLite on the... X-Git-Tag: rel_0_5_1~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16c710a227db0dad0ad91f84bce284ab450f9174;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git don't INSERT a blank row if no rows passed. (breaks all the tests for SQLite on the buildbot....) --- diff --git a/test/orm/_fixtures.py b/test/orm/_fixtures.py index 4d4e744adb..f036b92b2a 100644 --- a/test/orm/_fixtures.py +++ b/test/orm/_fixtures.py @@ -10,9 +10,10 @@ fixture_metadata = MetaData() def fixture_table(table, columns, *rows): def load_fixture(bind=None): bind = bind or table.bind - bind.execute( - table.insert(), - [dict(zip(columns, column_values)) for column_values in rows]) + if rows: + bind.execute( + table.insert(), + [dict(zip(columns, column_values)) for column_values in rows]) table.info[('fixture', 'loader')] = load_fixture table.info[('fixture', 'columns')] = columns table.info[('fixture', 'rows')] = rows