question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytest.Instance not raising deprecation warning like intended?

See original GitHub issue

Personally 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:closed
  • Created 2 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
The-Compilercommented, Nov 28, 2021

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?

1reaction
bluetechcommented, Nov 28, 2021

(BTW, @CaselIT, you should apply the following patch if you’re able – pytest 7 warns about it (it has always been a mistake).

diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py
index d79931b91..7bc88a14b 100644
--- a/lib/sqlalchemy/testing/plugin/plugin_base.py
+++ b/lib/sqlalchemy/testing/plugin/plugin_base.py
@@ -86,7 +86,7 @@ def setup_options(make_option):
     make_option(
         "--dbdriver",
         action="append",
-        type="string",
+        type=str,
         dest="dbdriver",
         help="Additional database drivers to include in tests.  "
         "These are linked to the existing database URLs by the "

)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found