Skip to content

fix: OAuth datetime timezone handling (#265)#280

Merged
anchapin merged 2 commits into
mainfrom
fix/oauth-datetime-timezone-handling-265
Mar 8, 2026
Merged

fix: OAuth datetime timezone handling (#265)#280
anchapin merged 2 commits into
mainfrom
fix/oauth-datetime-timezone-handling-265

Conversation

@anchapin

@anchapin anchapin commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes timezone-aware vs timezone-naive datetime comparison errors in OAuth manager tests.

Root Cause

Test fixtures were creating timezone-naive datetimes using while production code in uses timezone-aware datetimes with .

Changes

  • Replaced with in test fixtures
  • Added import to

Tests Fixed

All tests now pass.


Co-authored-by: openhands openhands@all-hands.dev

The simulation engine tests were failing due to leftover data from
previous test runs. Added database cleanup in the autouse fixture to
ensure test isolation by deleting all SimulationBid records before
each test runs.

This fixes issue #242: Fix pre-existing test failures in codebase

Co-authored-by: openhands <openhands@all-hands.dev>
- Replace datetime.utcnow() with datetime.now(timezone.utc) in test fixtures
- Add timezone import to test_oauth_manager.py
- Fixes TypeError when comparing timezone-naive and timezone-aware datetimes

Co-authored-by: openhands <openhands@all-hands.dev>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @anchapin, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@anchapin anchapin merged commit cdf1327 into main Mar 8, 2026
14 of 22 checks passed
@anchapin anchapin deleted the fix/oauth-datetime-timezone-handling-265 branch March 8, 2026 06:16
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