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

PTFE-864 Ensure datetimes are compared with timezones #439

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

tcarmet
Copy link
Contributor

@tcarmet tcarmet commented Sep 13, 2023

Now generating datetime with utc as timezone.

Using datetime.now(timezone.utc) instead of datetime.utcnow() as with utcnow the tzinfo remains None and is not able to compare datetimes that comes from GitHub's API which explicitly contain offset information.

@tcarmet tcarmet requested a review from a team as a code owner September 13, 2023 18:32
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2023

Codecov Report

Merging #439 (e113e20) into main (a9ae756) will increase coverage by 0.26%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
+ Coverage   83.45%   83.71%   +0.26%     
==========================================
  Files          31       31              
  Lines        1136     1136              
==========================================
+ Hits          948      951       +3     
+ Misses        188      185       -3     
Flag Coverage Δ
api 67.07% <40.00%> (ø)
unit 68.92% <100.00%> (+0.26%) ⬆️

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

Files Changed Coverage Δ
runner_manager/models/runner.py 98.92% <100.00%> (ø)
runner_manager/models/runner_group.py 88.26% <100.00%> (ø)

... and 1 file with indirect coverage changes

@tcarmet tcarmet merged commit 3003475 into main Sep 13, 2023
@tcarmet tcarmet deleted the bugfix/PTFE-864-compare-time-with-timezones branch September 13, 2023 21:41
MartinS926 pushed a commit that referenced this pull request Sep 15, 2023
Now generating datetime with utc as timezone.

Using `datetime.now(timezone.utc)` instead of `datetime.utcnow()` as
with `utcnow` the `tzinfo` remains `None` and is not able to compare
datetimes that comes from GitHub's API which explicitly contain offset
information.
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