Documentation for table.convert(...), refs #302

This commit is contained in:
Simon Willison 2021-08-01 21:43:20 -07:00
commit 4c3bf97305
4 changed files with 53 additions and 7 deletions

View file

@ -38,6 +38,13 @@ def test_convert_output(fresh_db, drop, expected):
assert list(table.rows) == [expected]
def test_convert_output_multiple_column_error(fresh_db):
table = fresh_db["table"]
with pytest.raises(AssertionError) as excinfo:
table.convert(["title", "other"], lambda v: v, output="out")
assert "output= can only be used with a single column" in str(excinfo.value)
@pytest.mark.parametrize(
"type,expected",
(