Skip to content

Commit edc25b9

Browse files
committed
More debugging.
1 parent 5ff7637 commit edc25b9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

coverage/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ def combine_parallel_data(data, aliases=None, data_paths=None, strict=False):
727727

728728
files_combined = 0
729729
for f in files_to_combine:
730+
if data._debug and data._debug.should('dataio'):
731+
data._debug.write("Combining data file %r" % (f,))
730732
try:
731733
new_data = CoverageData(f, debug=data._debug)
732734
new_data.read()

coverage/sqldata.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ def __nonzero__(self):
167167

168168
__bool__ = __nonzero__
169169

170+
def dump(self): # pragma: debugging
171+
"""Write a dump of the database."""
172+
if self._debug:
173+
with self._connect() as con:
174+
self._debug.write(con.dump())
175+
170176
def _file_id(self, filename, add=False):
171177
"""Get the file id for `filename`.
172178
@@ -519,3 +525,7 @@ def executemany(self, sql, data):
519525
if self.debug:
520526
self.debug.write("Executing many {!r} with {} rows".format(sql, len(data)))
521527
return self.con.executemany(sql, data)
528+
529+
def dump(self): # pragma: debugging
530+
"""Return a multi-line string, the dump of the database."""
531+
return "\n".join(self.con.iterdump())

0 commit comments

Comments
 (0)