mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

mutmut "ignoring" test

Open SebRut opened this issue 3 years ago • 7 comments

Hi, I'm trying out mutmut on https://github.com/SebRut/pygrocy and mutmut reports this mutant (affected file):

+++ pygrocy/data_models/meal_items.py
@@ -13,7 +13,7 @@
     def __init__(self, response: RecipeDetailsResponse):
         self._id = response.id
         self._name = response.name
-        self._description = response.description
+        self._description = None
         self._base_servings = response.base_servings
         self._desired_servings = response.desired_servings
         self._picture_file_name = response.picture_file_name

In my opinion this mutant should be killed with this line and indeed when running my tests manually using pytest and applying the mutant the test fails at the linked location.

SebRut avatar Apr 03 '21 06:04 SebRut

Maybe the cache is doing this? You could try deleting .mutmut_cache

boxed avatar Apr 04 '21 08:04 boxed

I'm pretty sure I tried this before, but I'll give it another shot.

SebRut avatar Apr 04 '21 09:04 SebRut

Ok, I ran mutmut run again after removing .mutmut_cache but the mutant (and other mutants with similar issues that should be killed) still shows up.

SebRut avatar Apr 04 '21 09:04 SebRut

That's strange. And if you do mutmut apply <id> you get the mutant you expect on disk and the tests fails?

boxed avatar Apr 07 '21 12:04 boxed

Yep, I recorded my repro steps here, maybe I'm missing something obvious: https://asciinema.org/a/YuWUnK3cmJtqvj1XLvVkRFMqW

SebRut avatar Apr 07 '21 12:04 SebRut

Nice use of asciinema! I wouldn't have thought of that :P

Yea that looks pretty clear cut.

boxed avatar Apr 15 '21 08:04 boxed

I’m running into this issue as well.

willfrey avatar May 20 '21 06:05 willfrey