Skip to content

Commit cfa7ed1

Browse files
add test to cover unregistration of a blocked plugin
1 parent eb70fb9 commit cfa7ed1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

testing/test_pluginmanager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@ def he_method1(self): ... # pragma: no cover
201201
pm.unregister(my)
202202

203203

204+
def test_unregister_blocked(pm: PluginManager) -> None:
205+
class Plugin:
206+
pass
207+
208+
p = Plugin()
209+
pm.set_blocked("error")
210+
pm.register(p, "error")
211+
# bloked plugins can be unregistred many times atm
212+
pm.unregister(p, "error")
213+
pm.unregister(p, "error")
214+
215+
204216
def test_register_unknown_hooks(pm: PluginManager) -> None:
205217
class Plugin1:
206218
@hookimpl

0 commit comments

Comments
 (0)