sqlite-utils duplicate command, closes #454, refs #449

Also made it so .duplicate() raises new NoTable exception rather than raising
an AssertionError if the source table does not exist.
This commit is contained in:
Simon Willison 2022-07-15 14:45:14 -07:00
commit c710ade644
7 changed files with 80 additions and 3 deletions

View file

@ -1,3 +1,4 @@
from sqlite_utils.db import NoTable
import datetime
import pytest
@ -38,5 +39,5 @@ def test_duplicate(fresh_db):
def test_duplicate_fails_if_table_does_not_exist(fresh_db):
with pytest.raises(AssertionError):
with pytest.raises(NoTable):
fresh_db["not_a_table"].duplicate("duplicated")