Support Database(memory=True) for in-memory databases

This commit is contained in:
Simon Willison 2019-07-22 17:12:54 -07:00
commit 034d498b31
4 changed files with 25 additions and 6 deletions

View file

@ -727,3 +727,10 @@ def test_create_table_numpy(fresh_db):
"np.uint8": 8,
}
] == list(fresh_db["types"].rows)
def test_cannot_provide_both_filename_and_memory():
with pytest.raises(
AssertionError, match="Either specify a filename_or_conn or pass memory=True"
):
db = Database("/tmp/foo.db", memory=True)