Some date bugs only show up on specific days: Feb 29, the last day of a month, New Year's Eve, a DST change. You can't wait for those dates to test them, so the bugs ship.
pytest-calendar-chaos runs a marked test once for each of those moments, with the clock frozen using time-machine:
@pytest.mark.calendar_chaos( cases=["leap_day", "month_end", "dst"], zones=["UTC", "America/New_York"] ) def test_subscription_renewal(): ... The presets cover leap day, month end, year end, midnight, ISO week 53, the 2038 limit and DST changes. When a case fails, the report shows the exact mocked time and a command that reruns only that scenario. It's opt-in, so unmarked tests don't change.
pip install pytest-calendar-chaos It needs Python 3.10+ and pytest 8+. It's MIT licensed and at version 0.3.0 on PyPI. It's a small project, so bug reports are the most useful thing you can send me.



![Por qué dejé de pedirle a mi agente de IA que dibuje diagramas [Trazo - opensource]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4kpezqjb7mlexz9658u5.png)