Skip to content

test: kill convert_temp rounding precision mutant#58

Merged
deviantintegral merged 1 commit intomainfrom
copilot/improve-testing-for-mutants
Mar 2, 2026
Merged

test: kill convert_temp rounding precision mutant#58
deviantintegral merged 1 commit intomainfrom
copilot/improve-testing-for-mutants

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Mutation testing identified a surviving mutant in convert_temp: changing round(..., 1) to round(..., 2) was undetected because all existing Fahrenheit test inputs produced results with ≤1 significant decimal place, making both rounding depths equivalent.

Change

  • tests/test_models.py: Add test_fahrenheit_rounding_precision to TestConvertTemp using 22.3°C as input
def test_fahrenheit_rounding_precision(self):
    """22.3°C -> 72.14°F: round to 1 decimal gives 72.1, not 72.14."""
    assert convert_temp(22.3, TempUnit.FAHRENHEIT) == 72.1

22.3°C → 72.14°F: round(72.14, 1) = 72.1 vs round(72.14, 2) = 72.14 — the two rounding depths now produce distinguishable results.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Improve testing by adding or updating tests for mutant coverage Kill convert_temp rounding precision mutant Mar 2, 2026
@deviantintegral deviantintegral changed the title Kill convert_temp rounding precision mutant test: kill convert_temp rounding precision mutant Mar 2, 2026
Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
@deviantintegral deviantintegral force-pushed the copilot/improve-testing-for-mutants branch from 0258168 to 05c3c24 Compare March 2, 2026 13:35
@deviantintegral deviantintegral marked this pull request as ready for review March 2, 2026 13:38
@deviantintegral deviantintegral merged commit 5f8c105 into main Mar 2, 2026
6 checks passed
@deviantintegral deviantintegral deleted the copilot/improve-testing-for-mutants branch March 2, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants