Skip to content

Commit 4b61167

Browse files
committed
remove unused code for enums and staticmethod/classmethod
1 parent 2bf799a commit 4b61167

3 files changed

Lines changed: 0 additions & 202 deletions

File tree

src/mutmut/mutation/enum_mutation.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/mutmut/mutation/mutators.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from collections.abc import Callable
55
from collections.abc import Iterable
66
from collections.abc import Sequence
7-
from enum import Enum
87
from typing import Any
98
from typing import cast
109

@@ -22,41 +21,6 @@
2221
NON_ESCAPE_SEQUENCE = re.compile(r"((?<!\\)[^\\]+)")
2322

2423

25-
class MethodType(Enum):
26-
"""Type of method based on its decorator."""
27-
28-
STATICMETHOD = "staticmethod"
29-
CLASSMETHOD = "classmethod"
30-
INSTANCE = "instance"
31-
32-
33-
def get_method_type(method: cst.FunctionDef) -> MethodType | None:
34-
"""Determine the method type based on decorators.
35-
36-
Returns:
37-
MethodType.STATICMETHOD - for @staticmethod
38-
MethodType.CLASSMETHOD - for @classmethod
39-
MethodType.INSTANCE - for no decorators (regular instance method)
40-
None - for other/multiple decorators (should be skipped)
41-
"""
42-
if not method.decorators:
43-
return MethodType.INSTANCE
44-
45-
if len(method.decorators) != 1:
46-
# Multiple decorators - skip
47-
return None
48-
49-
decorator = method.decorators[0].decorator
50-
if isinstance(decorator, cst.Name):
51-
if decorator.value == "staticmethod":
52-
return MethodType.STATICMETHOD
53-
elif decorator.value == "classmethod":
54-
return MethodType.CLASSMETHOD
55-
56-
# Other decorator - skip
57-
return None
58-
59-
6024
def operator_number(node: cst.BaseNumber) -> Iterable[cst.BaseNumber]:
6125
if isinstance(node, cst.Integer | cst.Float):
6226
yield node.with_changes(value=repr(node.evaluated_value + 1))

tests/mutation/test_enum_handling.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)