Summary
With coverage.py 7.16.0 on Python 3.12.6/macOS arm64, the second CoverageData.update() into an in-memory destination raises DataError: ... database other_db is already in use.
Reproducer
from coverage import CoverageData
from pathlib import Path
from tempfile import TemporaryDirectory
with TemporaryDirectory() as root:
combined = CoverageData(no_disk=True)
for index in range(2):
source = CoverageData(basename=str(Path(root) / str(index)))
source.add_lines({"example.py": {index + 1}})
source.write()
combined.update(source)
print(combined.lines("example.py"))
Expected: the merged line numbers [1, 2].
Actual: the second call fails in coverage/sqldata.py at ATTACH DATABASE ? AS other_db, with sqlite3.OperationalError: database other_db is already in use, surfaced as coverage.exceptions.DataError.
A disk-backed destination works with the same inputs. Found while adding complete matrix-coverage aggregation to openvax/topiary; that implementation uses a temporary disk-backed database.
Summary
With coverage.py 7.16.0 on Python 3.12.6/macOS arm64, the second
CoverageData.update()into an in-memory destination raisesDataError: ... database other_db is already in use.Reproducer
Expected: the merged line numbers
[1, 2].Actual: the second call fails in
coverage/sqldata.pyatATTACH DATABASE ? AS other_db, withsqlite3.OperationalError: database other_db is already in use, surfaced ascoverage.exceptions.DataError.A disk-backed destination works with the same inputs. Found while adding complete matrix-coverage aggregation to openvax/topiary; that implementation uses a temporary disk-backed database.