Skip to content

Conversation

@chrimaho
Copy link
Contributor

@chrimaho chrimaho commented Sep 18, 2023

  • Updated documentation to include updated features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits.
  • Closes Add FutureWarning to deprecated_call() #11447
  • Create a new changelog file in the changelog folder.
  • Added yourself to AUTHORS in alphabetical order.
  • [ ]

Close #11447

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.

As futurewarning doesn't relate to deprecation,its wrong to add it there

@The-Compiler
Copy link
Member

@RonnyPfannschmidt I've mentioned this over in #11447 already, but the Python docs clearly disagree with you:

Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python.

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.

changing back to comment after reading up on the details probided by @The-Compiler

@RonnyPfannschmidt
Copy link
Member

@The-Compiler after crosschecking the documentation text used, i`m under the strong impression that

FutureWarning is supposed to be end user facing, not programmer facing - as such the usage in the programmer-facing library is incorrect

the documentation text is

Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python.

the linked library is clearly targeted at programmers and to my understanding it is using the wrong warning type here

IMHO we should not mix user facing warnings and programmer facing warnings without a way to control the choice

@The-Compiler
Copy link
Member

People test end-user facing applications with pytest (that's my primary usage of pytest, FWIW). We do already have a way to control which warning is emitted if you want to be specific: pytest.warns.

pytest.deprecated_call is already a rather "fuzzy" convenience alias because it doesn't discern DeprecationWarning and PendingDeprecationWarning. IMHO we shouldn't have it at all, yet here we are — and including two out of three deprecation-related stdlib warnings with an API with a generic name seems like a major footgun.

@RonnyPfannschmidt
Copy link
Member

thank you for elaborating, consider me convinced

@nicoddemus nicoddemus merged commit 8062743 into pytest-dev:main Sep 18, 2023
@nicoddemus
Copy link
Member

Thanks a lot everyone for the discussion and @chrimaho for the contribution!

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 FutureWarning to deprecated_call()

4 participants