Skip to content

Commit 6df9ee5

Browse files
andersknedbat
andauthored
fix: revert "Map also empty dictionaries to file" (#1629)
* Revert "Map also empty dictionaries to file" This reverts commit f54428f (#1347), which was a big regression in performance and file sizes when using dynamic_context, and is no longer needed for #972 as of 4cc3292 (#1538). Fixes #1586. Signed-off-by: Anders Kaseorg <andersk@mit.edu> * docs: details of the fix in pull #1629, fixing #1586. --------- Signed-off-by: Anders Kaseorg <andersk@mit.edu> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
1 parent 586b1ee commit 6df9ee5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGES.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ development at the same time, such as 4.5.x and 5.0.
2020
Unreleased
2121
----------
2222

23-
Nothing yet.
23+
- Fix: reverted a `change from 6.4.3 <pull 1347_>`_ that helped Cython, but
24+
also increased the size of data files when using dynamic contexts, as
25+
described in the now-fixed `issue 1586`_. The problem is now avoided due to a
26+
recent change (`issue 1538`_). Thanks to `Anders Kaseorg <pull 1629_>`_
27+
and David Szotten for persisting with problem reports and detailed diagnoses.
28+
29+
.. _issue 1586: https://github.com/nedbat/coveragepy/issues/1586
30+
.. _pull 1629: https://github.com/nedbat/coveragepy/pull/1629
2431

2532

2633
.. scriv-start-here

CONTRIBUTORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Alexander Todorov
1616
Alexander Walters
1717
Alpha Chen
1818
Ammar Askar
19+
Anders Kaseorg
1920
Andrew Hoos
2021
Anthony Sottile
2122
Arcadiy Ivanov

coverage/collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def mapped_file_dict(self, d: Mapping[str, T]) -> Dict[str, T]:
456456
assert isinstance(runtime_err, Exception)
457457
raise runtime_err
458458

459-
return {self.cached_mapped_file(k): v for k, v in items}
459+
return {self.cached_mapped_file(k): v for k, v in items if v}
460460

461461
def plugin_was_disabled(self, plugin: CoveragePlugin) -> None:
462462
"""Record that `plugin` was disabled during the run."""

0 commit comments

Comments
 (0)