@@ -16,6 +16,9 @@ def camel_to_snake(name: str) -> str:
1616class ChecklistItemMeta (type ):
1717 """Metaclass for checklist items that provides string representation."""
1818
19+ _path : str = ""
20+ _override_name : str = ""
21+
1922 def __new__ (mcs , name : str , bases : tuple , namespace : dict , ** kwargs ):
2023 """Create a new class with the parent path set."""
2124 parent_path = kwargs .get ("parent_path" , "" )
@@ -39,6 +42,7 @@ def __new__(mcs, name: str, bases: tuple, namespace: dict, **kwargs):
3942 for attr_name , attr_value in namespace .items ():
4043 if isinstance (attr_value , type ) and not attr_name .startswith ("_" ):
4144 # Create a new class with the parent path set
45+ assert isinstance (attr_value , ChecklistItemMeta )
4246 nested_cls = ChecklistItemMeta (
4347 attr_value .__name__ ,
4448 attr_value .__bases__ ,
@@ -62,10 +66,7 @@ def __repr__(cls) -> str:
6266class ChecklistItem (metaclass = ChecklistItemMeta ):
6367 """Base class for checklist items."""
6468
65- _path : str = ""
66- _override_name : str = ""
67-
68- def __new__ (cls , * args , ** kwargs ) -> pytest .MarkDecorator :
69+ def __new__ (cls , * args , ** kwargs ) -> pytest .MarkDecorator : # type: ignore
6970 """Return a pytest mark decorator for the checklist item."""
7071 return pytest .mark .eip_checklist (cls ._path , * args , ** kwargs )
7172
0 commit comments