Skip to content

Fix enums with custom __init__ failing to import under mutmut - #603

Open
zyv wants to merge 1 commit into
boxed:mainfrom
zyv:feature/fix-enum-import
Open

zyv wants to merge 1 commit into
boxed:mainfrom
zyv:feature/fix-enum-import

Conversation

@zyv

@zyv zyv commented Oct 16, 2026

Copy link
Copy Markdown

Enum calls __init__ and _generate_next_value_ once per member while the class is still being created, before the mutants dicts of its methods are filled in after the class body, so importing the mutated module raises KeyError: '_mutmut_orig'. Skip both on an enum class, like __new__.

Closes #600.

Enum calls `__init__` and `_generate_next_value_` once per member while the
class is still being created, before the mutants dicts of its methods are
filled in after the class body, so importing the mutated module raises
`KeyError: '_mutmut_orig'`. Skip both on an enum class, like `__new__`.

Closes boxed#600.
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.

Enums with custom __init__ cannot be imported under mutmut: KeyError: '_mutmut_orig'

1 participant