(tmpdir)
| 561 | |
| 562 | |
| 563 | def test_gc(tmpdir): |
| 564 | # See https://github.com/msiemens/tinydb/issues/92 |
| 565 | path = str(tmpdir.join('db.json')) |
| 566 | db = TinyDB(path) |
| 567 | table = db.table('foo') |
| 568 | table.insert({'something': 'else'}) |
| 569 | table.insert({'int': 13}) |
| 570 | assert len(table.search(where('int') == 13)) == 1 |
| 571 | assert table.all() == [{'something': 'else'}, {'int': 13}] |
| 572 | db.close() |
| 573 | |
| 574 | |
| 575 | def test_drop_table(): |