File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -124,30 +124,31 @@ class A:
124124
125125
126126def test_register_skips_properties (he_pm : PluginManager ) -> None :
127- class A :
127+ class ClassWithProperties :
128128 @property
129129 def some_func (self ):
130130 self .property_was_executed = True
131131 return None
132132
133- a = A ()
134- he_pm .register (a )
135- assert not a .property_was_executed
133+ test_plugin = ClassWithProperties ()
134+ he_pm .register (test_plugin )
135+ assert not test_plugin .property_was_executed
136136
137137
138138def test_register_skips_pydantic_fields (he_pm : PluginManager ) -> None :
139- class A :
139+ class PydanticModelClass :
140140 # stub to make object look like a pydantic model
141- model_fields = {"some_attr" : {}}
141+ model_fields : dict = {"some_attr" : {}}
142142
143143 def __pydantic_core_schema__ (self ): ...
144144
145145 @hookimpl
146146 def some_attr (self ): ...
147147
148- a = A ()
149- pname = he_pm .register (a )
150- assert not he_pm .get_hookcallers (he_pm .get_plugin (pname ))
148+ test_plugin = PydanticModelClass ()
149+ he_pm .register (test_plugin )
150+ with pytest .raises (AttributeError ) as excinfo :
151+ he_pm .hook .some_attr .get_hookimpls ()
151152
152153
153154def test_register_mismatch_method (he_pm : PluginManager ) -> None :
You can’t perform that action at this time.
0 commit comments