Skip to content

Conversation

@jenstroeger
Copy link
Contributor

Closes #11610

Please note that I also added a versionadded:: 7.5 to the method’s docstring, though I’m not exactly sure how you guys handle the version number.

Also, regarding typing of the fixture args please note the recent change python/typeshed#11018 and how with Python 3.12 the return type of the filter has changed. I am not sure how you’d like to handle that, please advise.

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 great, thanks!

@nicoddemus
Copy link
Member

nicoddemus commented Nov 20, 2023

Please note that I also added a versionadded:: 7.5 to the method’s docstring, though I’m not exactly sure how you guys handle the version number.

This is correct, although we are not sure if there will be a 7.5 release or we will go directly with 8.0; regardless when the time comes we will update the docs if needed.

Also, regarding typing of the fixture args please note the recent change python/typeshed#11018 and how with Python 3.12 the return type of the filter has changed. I am not sure how you’d like to handle that, please advise.

Not sure, how does that affect the filtering method? It receives a logging.Filter object, which seems correct and won't be affected by that?

Ahh OK, now I read python/typeshed#5700 and understand what you mean. Not sure how to proceed, I think leaving it as you wrote is more pragmatic, as _SupportsFilter is private anyway. Hmm or perhaps we can just copy that protocol over? It is only two lines after all.

@nicoddemus
Copy link
Member

Going ahead with this for now, we can improve typing later if we need. 👍

Thanks again @jenstroeger!

@nicoddemus nicoddemus merged commit acab13f into pytest-dev:main Nov 24, 2023
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.

Add a set_filter() context manager to the caplog fixture

2 participants