--ignore for sqlite-utils drop-table and drop-view, closes #237

This commit is contained in:
Simon Willison 2021-02-25 09:11:37 -08:00
commit bba6e241be
3 changed files with 36 additions and 9 deletions

View file

@ -1397,7 +1397,17 @@ def test_drop_table_error():
)
assert 1 == result.exit_code
assert 'Error: Table "t2" does not exist' == result.output.strip()
# Using --ignore supresses that error
result = runner.invoke(
cli.cli,
[
"drop-table",
"test.db",
"t2",
"--ignore"
],
)
assert 0 == result.exit_code
def test_drop_view():
runner = CliRunner()
@ -1432,6 +1442,17 @@ def test_drop_view_error():
)
assert 1 == result.exit_code
assert 'Error: View "t2" does not exist' == result.output.strip()
# Using --ignore supresses that error
result = runner.invoke(
cli.cli,
[
"drop-view",
"test.db",
"t2",
"--ignore"
],
)
assert 0 == result.exit_code
def test_enable_wal():