66
77import pytest
88
9- from sopel import bot , loader , module , plugins , trigger
9+ from sopel import bot , loader , module , plugin , plugins , trigger
1010from sopel .plugins import rules
1111from sopel .tests import rawlist
1212from sopel .tools import Identifier , SopelMemory
@@ -293,41 +293,41 @@ def test_register_unregister_plugin(tmpconfig, mockplugin):
293293def test_remove_plugin_unknown_plugin (tmpconfig ):
294294 sopel = bot .Sopel (tmpconfig , daemon = False )
295295
296- plugin = plugins .handlers .PyModulePlugin ('admin' , 'sopel.modules' )
296+ handler = plugins .handlers .PyModulePlugin ('admin' , 'sopel.modules' )
297297 with pytest .raises (plugins .exceptions .PluginNotRegistered ):
298- sopel .remove_plugin (plugin , [], [], [], [])
298+ sopel .remove_plugin (handler , [], [], [], [])
299299
300300
301301def test_remove_plugin_unregistered_plugin (tmpconfig ):
302302 sopel = bot .Sopel (tmpconfig , daemon = False )
303303
304304 # register the plugin
305- plugin = plugins .handlers .PyModulePlugin ('coretasks' , 'sopel' )
306- plugin .load ()
307- plugin .register (sopel )
305+ handler = plugins .handlers .PyModulePlugin ('coretasks' , 'sopel' )
306+ handler .load ()
307+ handler .register (sopel )
308308
309309 # Unregister the plugin
310- plugin .unregister (sopel )
310+ handler .unregister (sopel )
311311
312312 # And now it must raise an exception
313313 with pytest .raises (plugins .exceptions .PluginNotRegistered ):
314- sopel .remove_plugin (plugin , [], [], [], [])
314+ sopel .remove_plugin (handler , [], [], [], [])
315315
316316
317317def test_reload_plugin_unregistered_plugin (tmpconfig ):
318318 sopel = bot .Sopel (tmpconfig , daemon = False )
319319
320320 # register the plugin
321- plugin = plugins .handlers .PyModulePlugin ('coretasks' , 'sopel' )
322- plugin .load ()
323- plugin .register (sopel )
321+ handler = plugins .handlers .PyModulePlugin ('coretasks' , 'sopel' )
322+ handler .load ()
323+ handler .register (sopel )
324324
325325 # Unregister the plugin
326- plugin .unregister (sopel )
326+ handler .unregister (sopel )
327327
328328 # And now it must raise an exception
329329 with pytest .raises (plugins .exceptions .PluginNotRegistered ):
330- sopel .reload_plugin (plugin .name )
330+ sopel .reload_plugin (handler .name )
331331
332332
333333# -----------------------------------------------------------------------------
@@ -340,11 +340,11 @@ def test_register_callables(tmpconfig):
340340 def rule_hello (bot , trigger ):
341341 pass
342342
343- @module .find (r'(hi|hello|hey|sup)' )
343+ @plugin .find (r'(hi|hello|hey|sup)' )
344344 def rule_find_hello (bot , trigger ):
345345 pass
346346
347- @module .search (r'(hi|hello|hey|sup)' )
347+ @plugin .search (r'(hi|hello|hey|sup)' )
348348 def rule_search_hello (bot , trigger ):
349349 pass
350350
@@ -382,7 +382,7 @@ def mixed_rule_command(bot, trigger):
382382 pass
383383
384384 @module .event ('JOIN' )
385- @module .label ('handle_join_event' )
385+ @plugin .label ('handle_join_event' )
386386 def on_join (bot , trigger ):
387387 pass
388388
0 commit comments