diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-11-26 14:09:29 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-11-27 09:32:40 -0500 |
commit | 0818611c63a243e35a710d325bc63ffa93ef3cd7 (patch) | |
tree | b2482d1247be061f99799e458f15884183f81df3 /coverage/sqldata.py | |
parent | ff9839f5e2511f0c19332648e4dc61677a702ee6 (diff) | |
download | python-coveragepy-git-0818611c63a243e35a710d325bc63ffa93ef3cd7.tar.gz |
feat: implicit path mapping during reporting. #1212
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r-- | coverage/sqldata.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py index ea6b1199..68663715 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -648,7 +648,12 @@ class CoverageData(SimpleReprMixin): "inner join file on file.id = line_bits.file_id " + "inner join context on context.id = line_bits.context_id" ) - lines = {(files[path], context): numbits for (path, context, numbits) in cur} + lines = {} + for path, context, numbits in cur: + key = (files[path], context) + if key in lines: + numbits = numbits_union(lines[key], numbits) + lines[key] = numbits cur.close() # Get tracer data. |