Skip to content
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 changes cause test failures due to deprecation warning #1303

Open
s-t-e-v-e-n-k opened this issue Jan 9, 2024 · 0 comments
Open

Comments

@s-t-e-v-e-n-k
Copy link

Running the test suite under Python 3.12 has multiple failures that all stem from:

DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).

Since warnings are treated as errors, this causes a failure.

s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Jan 31, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a callable.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Jan 31, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a callable.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Jan 31, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a callable.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Jan 31, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a callable.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Feb 2, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a function.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Feb 2, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a function.

Fixes pallets-eco#1303
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/flask-sqlalchemy that referenced this issue Feb 3, 2024
datetime.utcnow() is deprecated for Python 3.12+, and raises a warning.
Since warnings are treated as errors, this results in test failures.
Since utcnow calls are done by the SQLAlchemy mapping machinery, we need
to use a function.

Fixes pallets-eco#1303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant