pytest.Instance not raising deprecation warning like intended?
See original GitHub issuePersonally I think it’s would be better to just remove this, since trying with sqlalchemy returned no warning whatsoever, just no collection. If it was removed we would have at least an attribute error to go by.
See also https://github.com/pytest-dev/pytest/issues/9343#issuecomment-980462563
To reproduce:
git clone https://github.com/sqlalchemy/sqlalchemy.git --depth 100
pip install git+https://github.com/pytest-dev/pytest.git
pytest -Werror
will run and print no tests ran in 13.57s
, so the warning seems to not trigger
_Originally posted by @CaselIT in https://github.com/pytest-dev/pytest/pull/9277#discussion_r757763440_
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Deprecations and Removals — pytest documentation
pytest.warns(None) is now deprecated because it was frequently misused. Its correct usage was checking that the code emits at least one warning of...
Read more >How to use pytest to assert NO Warning is raised
The solution suggested for pytest < 7.0, below, now raises a DeprecationWarning. Thanks to @Warren-Weckesser for signaling this in comment!
Read more >warnings — Warning control — Python 3.11.1 documentation
Temporarily Suppressing Warnings¶. If you are using code that you know will raise a warning, such as a deprecated function, but do not...
Read more >Python deprecation - DEV Community
When deprecating classes you have to consider two separate use cases. Instantiating an object of a deprecated class can throw a deprecation ......
Read more >API Reference — pytest documentation - Read the Docs
(This is only used when pytest.raises is used as a context manager, and passed through to the ... Tutorial: Ensuring code triggers a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No worries! I’ll take a false alarm before a release rather than a real alarm a few minutes after the release any day 😉
Thanks to everyone helping to debug this! I suppose we can close this one then?
(BTW, @CaselIT, you should apply the following patch if you’re able – pytest 7 warns about it (it has always been a mistake).
)