File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,33 @@ class A:
123
123
assert pm .register (A (), "somename" )
124
124
125
125
126
+ def test_register_skips_properties (he_pm : PluginManager ) -> None :
127
+ property_was_executed = False
128
+ class A :
129
+ @property
130
+ def some_func (self ):
131
+ property_was_executed = True
132
+
133
+ a = A ()
134
+ he_pm .register (a )
135
+ assert not property_was_executed
136
+
137
+
138
+ def test_register_skips_pydantic_fields (he_pm : PluginManager ) -> None :
139
+ class A :
140
+ # stub to make object look like a pydantic model
141
+ model_fields = {'some_attr' : {}}
142
+
143
+ def __pydantic_core_schema__ (self ): ...
144
+
145
+ @hookimpl
146
+ def some_attr (self ): ...
147
+
148
+ a = A ()
149
+ pname = he_pm .register (a )
150
+ assert not pm .get_hookcallers (pm .get_plugin (pname ))
151
+
152
+
126
153
def test_register_mismatch_method (he_pm : PluginManager ) -> None :
127
154
class hello :
128
155
@hookimpl
You can’t perform that action at this time.
0 commit comments