-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HookImpl.__repr__ #156
Conversation
This is helpful when debugging hooks being called. Example: > <HookImpl plugin_name='testmon', plugin_file='/path/to/plugin.py'>
pluggy/hooks.py
Outdated
def __repr__(self): | ||
return "<HookImpl plugin_name=%r, plugin_file=%r>" % ( | ||
self.plugin_name, | ||
self.plugin.__file__, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldnt this completely fall appart for class instance based plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - using repr()
now on the plugin.
As for the test: how would I test the non-instance based plugins? (as used with tox for example)
btw: I've tried to use instance based plugins with tox (tarpas/pytest-testmon#107), but it seems to have been just ignored then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thanks @blueyed!
@tgoodlet It was intended to be squash-merged though… |
@blueyed ahh shoot yeah I didn't look at the history in detail. It's no big deal we've had verbosity in the history like this before. Normally I just |
Yeah. OTOH it makes reviewing new changes and/or seeing how it evolved much easier using |
This is helpful when debugging hooks being called.
Example:
Using
"<HookImpl plugin=%r>" % (self.plugin,)
instead would result in: