Skip to content

Commit f05da83

Browse files
committed
Add HookImpl.__repr__
This is helpful when debugging hooks being called. Example: > <HookImpl plugin_name='testmon', plugin_file='/path/to/plugin.py'>
1 parent 76232fa commit f05da83

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pluggy/hooks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,9 @@ def __init__(self, plugin, plugin_name, function, hook_impl_opts):
315315
self.opts = hook_impl_opts
316316
self.plugin_name = plugin_name
317317
self.__dict__.update(hook_impl_opts)
318+
319+
def __repr__(self):
320+
return "<HookImpl plugin_name=%r, plugin_file=%r>" % (
321+
self.plugin_name,
322+
self.plugin.__file__,
323+
)

0 commit comments

Comments
 (0)