From 4b43eff1377e818db2c42521d98bf2a0973b1cb6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 7 Jul 2019 09:48:29 -0400 Subject: Log connections properly --- coverage/sqldata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'coverage/sqldata.py') diff --git a/coverage/sqldata.py b/coverage/sqldata.py index 34dd65c8..b8efd936 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -671,8 +671,6 @@ class SqliteDb(SimpleReprMixin): self.debug = debug if debug.should('sql') else None self.filename = filename self.nest = 0 - if self.debug: - self.debug.write("Connecting to {!r}".format(filename)) def connect(self): # SQLite on Windows on py2 won't open a file if the filename argument @@ -684,6 +682,8 @@ class SqliteDb(SimpleReprMixin): # effectively causing a nested context. However, given the indempotent # nature of the tracer operations, sharing a conenction among threads # is not a problem. + if self.debug: + self.debug.write("Connecting to {!r}".format(self.filename)) self.con = sqlite3.connect(filename, check_same_thread=False) # This pragma makes writing faster. It disables rollbacks, but we never need them. -- cgit v1.2.1