From 4af4762521fe3e1ced7fcade67eaeabf41213aab Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 15 Jul 2022 14:23:57 -0700 Subject: [PATCH] test_duplicate_fails_if_table_does_not_exist, refs #449 --- tests/test_duplicate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_duplicate.py b/tests/test_duplicate.py index 0324b00..f56556d 100644 --- a/tests/test_duplicate.py +++ b/tests/test_duplicate.py @@ -1,4 +1,5 @@ import datetime +import pytest def test_duplicate(fresh_db): @@ -34,3 +35,8 @@ def test_duplicate(fresh_db): {"name": "bool_col", "type": "INT"}, {"name": "datetime_col", "type": "TEXT"}, ] == [{"name": col.name, "type": col.type} for col in table2.columns] + + +def test_duplicate_fails_if_table_does_not_exist(fresh_db): + with pytest.raises(AssertionError): + fresh_db["not_a_table"].duplicate("duplicated")