Skip to content

Commit

Permalink
Chore: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
msiemens committed Feb 25, 2019
1 parent a320136 commit 74b89fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_tinydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest

from tinydb import TinyDB, where
from tinydb.storages import MemoryStorage
from tinydb.middlewares import Middleware
from tinydb.storages import MemoryStorage


def test_purge(db):
Expand Down
5 changes: 3 additions & 2 deletions tinydb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def __repr__(self):
'tables_count={}'.format(len(self.tables())),
'default_table_documents_count={}'.format(self.__len__()),
'all_tables_documents_count={}'.format(
['{}={}'.format(table, len(self.table(table))) for table in self.tables()]),
['{}={}'.format(table, len(self.table(table)))
for table in self.tables()]),
]

return '<{} {}>'.format(type(self).__name__, ', '.join(args))
Expand Down Expand Up @@ -406,7 +407,7 @@ def _write(self, values):
:type values: DataProxy | dict
"""

self._query_cache.clear()
self.clear_cache()
self._storage.write(values)

def __len__(self):
Expand Down

0 comments on commit 74b89fa

Please sign in to comment.