# AssertionError: assert datetime.date(2025, 1, 1) == datetime.date(2024, 12, 31)
# only fails in CI in UTC

- **ID:** `python/pytest-freezegun-timezone`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

freezegun freezes UTC time by default; tests that assert on local time or use timezone-aware code fail when developer machine TZ differs from CI TZ.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.5 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   from freezegun import freeze_time

@freeze_time('2025-01-01 00:00:00', tz_offset=0)
def test_x():
    ...

# or use tz-aware datetimes in assertions
   ```
2. **** (88% success)
   ```
   from datetime import datetime, timezone

now = datetime.now(timezone.utc)
# assert against UTC-aware values in tests
   ```

## Dead Ends

- **** — Makes CI match freezegun but local runs diverge; the underlying timezone-aware bug remains. (85% fail)
- **** — freezegun interprets the string as UTC; local-time assertions still fail. (90% fail)
- **** — Tests become flaky around midnight and month boundaries; loses determinism. (80% fail)
