pallets-eco / flask-sqlalchemy

Adds SQLAlchemy support to Flask
https://flask-sqlalchemy.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
4.18k stars 896 forks source link

Stop using datetime.utcnow() in tests #1308

Closed s-t-e-v-e-n-k closed 2 months ago

s-t-e-v-e-n-k commented 5 months ago

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 #1303

Checklist:

s-t-e-v-e-n-k commented 4 months ago

I have addressed both comments, thanks!

s-t-e-v-e-n-k commented 4 months ago

@davidism Thanks, I've reverted that bit.

davidism commented 2 months ago

Sorry, completely forgot about this PR and ended up fixing it myself when doing some updates. Thanks for working on it!