Skip to content

Commit 6aaaf0e

Browse files
add failing test for issue #17
1 parent 71c1cb3 commit 6aaaf0e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

testing/test_pluggy.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,20 @@ def hello_myhook(self, arg1):
656656
results = pm.hook.hello_myhook(arg1=17)
657657
assert results == [18, 18]
658658

659+
def test_prefix_hookimpl_dontmatch_module(self):
660+
pm = PluginManager(hookspec.project_name, "hello_")
661+
662+
class BadPlugin:
663+
def hello_fine(self):
664+
pass
665+
hello_fine.optionalhook = True
666+
667+
hello_module = __import__('email')
668+
669+
pm.register(BadPlugin())
670+
pm.check_pending()
671+
672+
659673

660674
def test_parse_hookimpl_override():
661675
class MyPluginManager(PluginManager):

0 commit comments

Comments
 (0)