Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_custom_table_class_via_class_attribute(db):
TinyDB.table_class = SmartCacheTable
table = db.table('table3')
assert isinstance(table, SmartCacheTable)
TinyDB.table_class = Table
def db_smartcache():
TinyDB.table_class = SmartCacheTable
db_ = TinyDB(storage=MemoryStorage)
table = db_.table('_default')
table.insert_multiple({'int': 1, 'char': c} for c in 'abc')
return table
def test_custom_table_class_via_class_attribute(db):
TinyDB.table_class = SmartCacheTable
table = db.table('table3')
assert isinstance(table, SmartCacheTable)
TinyDB.table_class = Table