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

Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. [SQUASH] #10012

Merged
merged 5 commits into from Aug 8, 2022

Conversation

graingert
Copy link
Member

@graingert graingert commented Jun 1, 2022

currently the PytestUnhandledCoroutineWarning are a regular PytestWarning. However really they are just a more important special case of PytestReturnNotNoneWarning

If the plan is to upbraid PytestReturnNotNoneWarning into a PytestReturnNotNoneError in pytest 8, we should turn both of these into an error at the same time.

See #9956 (comment)
And #7363

src/_pytest/warning_types.py Outdated Show resolved Hide resolved
@graingert graingert closed this Jun 1, 2022
@graingert graingert deleted the graingert-patch-1 branch June 1, 2022 16:35
@graingert graingert restored the graingert-patch-1 branch July 29, 2022 09:22
@graingert graingert reopened this Jul 29, 2022
@graingert graingert changed the title upgrade CoroutineWarning to DeprecationWarning upgrade PytestUnhandledCoroutineWarning to DeprecationWarning Jul 29, 2022
@graingert graingert changed the title upgrade PytestUnhandledCoroutineWarning to DeprecationWarning upgrade PytestUnhandledCoroutineWarning to PytestDeprecationWarning Jul 29, 2022
@graingert graingert marked this pull request as ready for review July 29, 2022 09:35
@@ -55,7 +55,6 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning):
__module__ = "pytest"


@final
class PytestReturnNotNoneWarning(PytestDeprecationWarning):
Copy link
Member Author

@graingert graingert Jul 29, 2022

Choose a reason for hiding this comment

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

@RonnyPfannschmidt requested that PytestReturnNotNoneWarning be a RemovedIn8Warning and I agree, but the @final decorator on RemovedIn8Warning prevents that.

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.

Looks good, however I think this warrants a changelog entry?

changelog/10012.deprecation.rst Outdated Show resolved Hide resolved
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
@graingert graingert changed the title upgrade PytestUnhandledCoroutineWarning to PytestDeprecationWarning Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. Aug 5, 2022
@graingert
Copy link
Member Author

graingert commented Aug 5, 2022

@nicoddemus what do you think about making RemovedIn8Warning not-final? Ideally it would be sealed: mypyc/mypyc#846 rather than final

@nicoddemus
Copy link
Member

I'm OK with making it not-final 👍

@nicoddemus nicoddemus changed the title Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. [SQUASH] Aug 5, 2022
@graingert graingert merged commit 58cf20e into main Aug 8, 2022
24 checks passed
@graingert graingert deleted the graingert-patch-1 branch August 8, 2022 09:14
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