Skip to content
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 .plugin member to PluginValidationError to access failing plugin #122

Merged
merged 3 commits into from
Mar 19, 2018
Merged

Add .plugin member to PluginValidationError to access failing plugin #122

merged 3 commits into from
Mar 19, 2018

Conversation

ids1024
Copy link
Contributor

@ids1024 ids1024 commented Jan 31, 2018

The goal of this is to be able to call .check_pending() catching the exception, then unregister the plugin and print a message, allowing the program to continue without that plugin. If there is already a way to do this, I haven't found it.

@@ -6,6 +6,10 @@
class PluginValidationError(Exception):
""" plugin failed validation. """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this to the docs:

""" plugin failed validation. 

:param object plugin: the plugin which failed validation, may be a module or an arbitrary object.
"""

@nicoddemus
Copy link
Member

Thanks!

@goodboy
Copy link
Contributor

goodboy commented Feb 15, 2018

Thanks @ids1024 can you please write a test for this which demonstrates and validates the feature.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely and to the point ^^

Copy link
Contributor

@goodboy goodboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@goodboy goodboy merged commit 366946a into pytest-dev:master Mar 19, 2018
@ids1024 ids1024 deleted the PluginValidationError-plugin branch March 19, 2018 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants