Skip to content

Commit c89609a

Browse files
BUG: fix incorrect number of wheels in logs (#2517)
* BUG: fix incorrect number of wheels in logs * add a test --------- Co-authored-by: mayeut <[email protected]>
1 parent 13b086e commit c89609a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cibuildwheel/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def print_summary(self, *, options: "Options") -> Generator[None, None, None]:
242242
github_summary = self._github_step_summary(duration=duration, options=options)
243243
Path(summary_path).write_text(filter_ansi_codes(github_summary), encoding="utf-8")
244244

245-
n_wheels = len([info for info in self.summary if not info.filename])
245+
n_wheels = len([info for info in self.summary if info.filename])
246246
s = "s" if n_wheels > 1 else ""
247247
duration_str = humanize.naturaldelta(duration)
248248
print()

unit_test/wheel_print_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@ def test_printout_wheels(capsys):
1515
log.colors_enabled = False
1616

1717
with log.print_summary(options=OPTIONS_DEFAULTS):
18+
# the number of BuildInfo with & without filename shall be different for this test
1819
log.summary = [
1920
BuildInfo(identifier="id1", filename=None, duration=3),
2021
BuildInfo(identifier="id2", filename=FILE, duration=2),
22+
BuildInfo(identifier="id3", filename=FILE, duration=3),
2123
]
2224

2325
captured = capsys.readouterr()
2426
assert captured.err == ""
2527

2628
assert "id1" in captured.out
2729
assert "id2" in captured.out
28-
assert "1 wheel produced in" in captured.out
30+
assert "id3" in captured.out
31+
assert "2 wheels produced in" in captured.out
2932
assert "SHA256=" in captured.out
3033

3134

0 commit comments

Comments
 (0)