Test for with db.tracer() contextmanager

This commit is contained in:
Simon Willison 2020-09-07 14:39:33 -07:00
commit 31bea2ac61
2 changed files with 29 additions and 1 deletions

View file

@ -130,7 +130,7 @@ class Database:
@contextlib.contextmanager
def tracer(self, tracer=None):
prev_tracer = self.tracer
prev_tracer = self._tracer
self._tracer = tracer or print
try:
yield self