Change the TimestampStrings check to check for str instead of not ZoneInfo.

This fixes the pytest problem which threw:
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

during Mocking
This commit is contained in:
Clemens Schwaighofer
2025-09-25 15:36:47 +09:00
parent ca0ab2d7d1
commit bb60a570d0
4 changed files with 51 additions and 11 deletions

View File

@@ -22,6 +22,9 @@ def main():
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
ts = TimestampStrings(ZoneInfo("Europe/Vienna"))
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
custom_tz = 'Europe/Paris'
ts = TimestampStrings(time_zone=custom_tz)
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
if __name__ == "__main__":