diff --git a/src/atm/main.py b/src/atm/main.py index c129b8b..3c6589c 100644 --- a/src/atm/main.py +++ b/src/atm/main.py @@ -8,7 +8,7 @@ import os import sys import time from dataclasses import dataclass -from datetime import datetime +from datetime import datetime, tzinfo from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Protocol, cast @@ -742,8 +742,8 @@ def _should_skip(now_ts: float, state: LifecycleState, cfg, canary) -> str | Non if oh is None or not oh.enabled: return None tz = getattr(oh, "_tz_cache", None) - if tz is None: - # Enabled but no tz resolved — skip the check rather than crash mid-loop. + if not isinstance(tz, tzinfo): + # Enabled but no tz resolved (or mock cfg in tests) — skip rather than crash. return None now_exchange = datetime.fromtimestamp(now_ts, tz=tz) # weekday() = 0..6 (MON..SUN). Locale-free; strftime('%a') is not.