-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix DeprecationWarning #865
Fix DeprecationWarning #865
Conversation
`datetime.datetime.utcnow` has been deprecated by Python and will soon be removed by Python 3.14 Besides, users of this plugin have lots of warning during their tests because of that which make testing experience uncomfortable. I thus thought that contribution would be nice
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #865 +/- ##
==========================================
- Coverage 95.45% 91.02% -4.44%
==========================================
Files 13 13
Lines 396 401 +5
==========================================
- Hits 378 365 -13
- Misses 18 36 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And a newsfragment will be needed
pytest_postgresql/retry.py
Outdated
@@ -19,7 +19,7 @@ def retry( | |||
... :: | |||
FATAL: the database system is starting up | |||
""" | |||
time: datetime = datetime.utcnow() | |||
time: datetime = datetime.now(UTC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not compatible with python 3.8 (eol at October 2024), 3.9 (eol at October 2025) and 3.10 (eol at October 2026).
I'd want to have some compatibility layer for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! Thank you for your feedback. I will implement a compatibility layer for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
40c0855
to
ce40f6e
Compare
@ericdasse-stonal could you add newsfragment with description as well? |
Sure. To do that, do I need to create an issue first? |
No need, you can refer to this pr number as well |
Alright. I took care of it |
datetime.datetime.utcnow
has been deprecated by Python and will soon be removed by Python 3.14 (see warning text below)Besides, this warning pops up everytime someone with a recent version of Python (3.12+) uses this plugin, which makes the testing experience uncomfortable. I thus thought this contribution would be nice
Chore that needs to be done:
pipenv run towncrier create [issue_number].[type].rst
Types are defined in the pyproject.toml, issue_numer either from issue tracker or the Pull request number