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

permit node to warn with any warning type, not just PytestWarning #8052

Merged

Conversation

symonk
Copy link
Member

@symonk symonk commented Nov 19, 2020

Hi all, as per #7615 This pr enabled the item node.warn to handle any subclass of Warning rather than be explicitly locked to instances / subclass of PytestWarning. I am not entirely sure on the 'use-case' for this but I'm just working on contributions and came across the issue. Normally I wouldn't be a fan of isinstance checking and raising a ValueError under such scenario(s) but I kept the same internals as previously here because otherwise a generic TypeError is raised which offers little benefit to the caller.

Thanks!

@symonk
Copy link
Member Author

symonk commented Nov 21, 2020

@nicoddemus can you advise on merge guidelines? Im unsure if it requires atleast 2 approvals :)

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @symonk!

Took the liberty of adding links to the CHANGELOG and a ..versionchanged notice to the docstring. 👍

@nicoddemus
Copy link
Member

@nicoddemus can you advise on merge guidelines? Im unsure if it requires atleast 2 approvals :)

We don't have a hard rule here... I think if you got at least one approval, you're free to merge the PR yourself, but often is good to get at least two or more approvals to make sure people can make further suggestions (like I just did here). Also helps to leave a quick notice like: "I will merge this later/tomorrow unless someone would like to give this another look", and see if anybody manifests. 😁

Either way don't hesitate to ask. 👍

@nicoddemus nicoddemus merged commit 52fef81 into pytest-dev:master Nov 21, 2020
@nicoddemus
Copy link
Member

A quick hint: leave a phrase like "Closes #7615" in the PR description so GitHub will close the issue automatically for us when the PR gets merged. 👍

@symonk symonk deleted the permit-node-warning-for-all-warnings branch November 21, 2020 13:52
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Nov 21, 2020
While adding links to pytest-dev#8052, noticed
a few more missing.
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.

None yet

3 participants