Use assertion to enforce <=999 columns

This commit is contained in:
Simon Willison 2019-07-28 14:41:57 +03:00
commit 0c1b8b7f96
2 changed files with 7 additions and 2 deletions

View file

@ -530,7 +530,7 @@ def test_bulk_insert_more_than_999_values(fresh_db):
def test_error_if_more_than_999_columns(fresh_db, num_columns, should_error):
record = dict([("c{}".format(i), i) for i in range(num_columns)])
if should_error:
with pytest.raises(Exception):
with pytest.raises(AssertionError):
fresh_db["big"].insert(record)
else:
fresh_db["big"].insert(record)