import sqlite3
db_disk = sqlite3.connect("/path/to/database.db")
db_mem = sqlite3.connect(":memory:")
db_disk.backup(db_mem) # this is the cool bit
and now you have an in-memory copy of your SQLite database that you can use as a test fixture.
import sqlite3
db_disk = sqlite3.connect("/path/to/database.db")
db_mem = sqlite3.connect(":memory:")
db_disk.backup(db_mem) # this is the cool bit
and now you have an in-memory copy of your SQLite database that you can use as a test fixture.
If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/gvwilson/statuses/114316283939691522 on your instance and quote it. (Note that quoting is not supported in Mastodon.)