Use parametrize for FTS test

This commit is contained in:
Simon Willison 2022-06-27 23:41:13 +00:00
commit 42440d6345

View file

@ -180,8 +180,8 @@ def test_populate_fts_escape_table_names(fresh_db):
] == list(table.search("usa")) ] == list(table.search("usa"))
def test_fts_tokenize(fresh_db): @pytest.mark.parametrize("fts_version", ("4", "5"))
for fts_version in ("4", "5"): def test_fts_tokenize(fresh_db, fts_version):
table_name = "searchable_{}".format(fts_version) table_name = "searchable_{}".format(fts_version)
table = fresh_db[table_name] table = fresh_db[table_name]
table.insert_all(search_records) table.insert_all(search_records)