-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Python 3.12] Assertion rewriting triggers DeprecationWarning #10977
Labels
topic: rewrite
related to the assertion rewrite mechanism
type: enhancement
new feature or API change, should be merged into features branch
Comments
bluetech
added a commit
that referenced
this issue
May 10, 2023
Zac-HD
added
type: enhancement
new feature or API change, should be merged into features branch
topic: rewrite
related to the assertion rewrite mechanism
labels
May 15, 2023
bluetech
added a commit
that referenced
this issue
May 23, 2023
bluetech
added a commit
that referenced
this issue
May 23, 2023
5 tasks
4 tasks
bluetech
added a commit
that referenced
this issue
May 26, 2023
bluetech
added a commit
that referenced
this issue
May 26, 2023
scop
added a commit
to scop/pytekukko
that referenced
this issue
May 27, 2023
3 tasks
1 task
mjpieters
added a commit
to aio-libs/frozenlist
that referenced
this issue
Jun 6, 2023
These warnings otherwise would abort the test suite. See pytest-dev/pytest#10977.
mjpieters
added a commit
to aio-libs/frozenlist
that referenced
this issue
Jun 6, 2023
These warnings otherwise would abort the test suite. See pytest-dev/pytest#10977.
mjpieters
added a commit
to aio-libs/frozenlist
that referenced
this issue
Jun 6, 2023
These warnings otherwise would abort the test suite. See pytest-dev/pytest#10977.
mjpieters
added a commit
to aio-libs/yarl
that referenced
this issue
Jun 6, 2023
These warnings otherwise would abort the test suite. See pytest-dev/pytest#10977.
mjpieters
added a commit
to aio-libs/yarl
that referenced
this issue
Jun 7, 2023
These warnings otherwise would abort the test suite. See pytest-dev/pytest#10977.
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this issue
Jun 9, 2023
graingert
added a commit
to graingert/urllib3
that referenced
this issue
Jul 12, 2023
zaro0508
pushed a commit
to Sceptre/sceptre
that referenced
this issue
Dec 3, 2023
Adds explicit support for Python 3.12. These are the minimal changes I needed for `pytest` to pass on 3.12 and macOS: * Replaces deprecated [`datetime.datetime.utcnow`](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow) * Replaces `called_once_with` with `assert_called_once_with`, which now [raises](python/cpython#100690) `AttributeError: 'called_once_with' is not a valid assertion` * Bumps `pytest` due to `DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead` pytest-dev/pytest#10977 * Refreshes the lockfile depends on #1393
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
topic: rewrite
related to the assertion rewrite mechanism
type: enhancement
new feature or API change, should be merged into features branch
What's the problem this feature will solve?
As of pytest 7.3.1, the classes
ast.Str
andast.NameConstant
are used in assertion rewriting. Their use has been deprecated in Python 3.8. These classes will emit a DeprecationWarning starting with Python 3.12.When a user runs pytest 7.3.1 on Python 3.12and pytest collects a test with an
assert
statement, the test will show deprecation warnings.Describe the solution you'd like
Pytest does not trigger a DeprecationWarning when running tests on Python 3.12.
Tested with pytest 7.3.1 on Python 3.12 (commit 0aeda29793):
test_anything.py
The text was updated successfully, but these errors were encountered: