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

Fix deprecation warnings for datetime.utcnow() #1119

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Aug 18, 2024

This shows up when running the tests on 3.12:

~dev/babel/tests/test_dates.py:757: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to rep
resent datetimes in UTC: datetime.datetime.now(datetime.UTC).                                                                                                                                 
    assert dates.format_datetime(datetime.utcnow(), locale="ja_JP@mod")

I think there's no harm in using plain datetime.now() for these tests.

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.22%. Comparing base (cf7d223) to head (0969ad5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1119   +/-   ##
=======================================
  Coverage   91.22%   91.22%           
=======================================
  Files          27       27           
  Lines        4561     4561           
=======================================
  Hits         4161     4161           
  Misses        400      400           
Flag Coverage Δ
macos-12-3.10 90.02% <ø> (ø)
macos-12-3.11 89.95% <ø> (ø)
macos-12-3.12 90.13% <ø> (ø)
macos-12-3.13-dev 89.65% <ø> (ø)
macos-12-3.8 89.95% <ø> (ø)
macos-12-3.9 89.95% <ø> (ø)
macos-12-pypy3.10 90.02% <ø> (ø)
ubuntu-22.04-3.10 90.04% <ø> (ø)
ubuntu-22.04-3.11 89.98% <ø> (ø)
ubuntu-22.04-3.12 90.15% <ø> (ø)
ubuntu-22.04-3.13-dev 89.67% <ø> (ø)
ubuntu-22.04-3.8 89.97% <ø> (ø)
ubuntu-22.04-3.9 89.97% <ø> (ø)
ubuntu-22.04-pypy3.10 90.04% <ø> (ø)
windows-2022-3.10 90.16% <ø> (ø)
windows-2022-3.11 90.10% <ø> (ø)
windows-2022-3.12 90.27% <ø> (ø)
windows-2022-3.13-dev 89.79% <ø> (ø)
windows-2022-3.8 90.09% <ø> (ø)
windows-2022-3.9 90.09% <ø> (ø)
windows-2022-pypy3.10 90.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akx akx merged commit b42344d into python-babel:master Aug 28, 2024
26 checks passed
@tomasr8 tomasr8 deleted the utcnow branch August 28, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants