Skip to content

Commit 92cad80

Browse files
committed
fix: repot logging assertions
1 parent 5a46b0a commit 92cad80

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

β€Žsrc/mutahunter/core/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def generate_mutant_report(
6767
)
6868
line_coverage = f"{line_rate * 100:.2f}%"
6969

70-
logger.info("πŸ“Š Line Coverage: %.2f%% πŸ“Š", line_rate * 100)
70+
logger.info("πŸ“Š Line Coverage: %s πŸ“Š", line_coverage)
7171
logger.info("🎯 Mutation Coverage: %s 🎯", total_mutation_coverage)
7272
logger.info("🦠 Total Mutants: %d 🦠", len(mutants))
7373
logger.info("πŸ›‘οΈ Survived Mutants: %d πŸ›‘οΈ", len(survived_mutants))

β€Žtests/test_report.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ def test_generate_mutant_report(mutants, config):
135135
patch("mutahunter.core.logger.logger.info") as mock_logger_info,
136136
):
137137
report.generate_mutant_report(mutants, 0.0, 0.0)
138-
138+
mock_logger_info.assert_any_call("πŸ“Š Line Coverage: %s πŸ“Š", "0.00%")
139+
mock_logger_info.assert_any_call("🎯 Mutation Coverage: %s 🎯", "50.00%")
139140
mock_logger_info.assert_any_call("🦠 Total Mutants: %d 🦠", len(mutants))
140141
mock_logger_info.assert_any_call("πŸ›‘οΈ Survived Mutants: %d πŸ›‘οΈ", 2)
141142
mock_logger_info.assert_any_call("πŸ—‘οΈ Killed Mutants: %d πŸ—‘οΈ", 2)
142143
mock_logger_info.assert_any_call("πŸ•’ Timeout Mutants: %d πŸ•’", 0)
143144
mock_logger_info.assert_any_call("πŸ”₯ Compile Error Mutants: %d πŸ”₯", 0)
144-
mock_logger_info.assert_any_call("🎯 Mutation Coverage: %s 🎯", "50.00%")
145145
mock_logger_info.assert_any_call("πŸ’° Expected Cost: $%.5f USD πŸ’°", 0.0)
146146

147147
mock_save_report.assert_called_once_with(
@@ -153,6 +153,7 @@ def test_generate_mutant_report(mutants, config):
153153
"timeout_mutants": 0,
154154
"compile_error_mutants": 0,
155155
"mutation_coverage": "50.00%",
156+
"line_coverage": "0.00%",
156157
"expected_cost": 0.0,
157158
},
158159
)

0 commit comments

Comments
Β (0)