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:
@@ -28,7 +28,7 @@ class TimestampStrings:
|
||||
self.time_zone = time_zone if time_zone is not None else self.TIME_ZONE
|
||||
try:
|
||||
self.timestamp_now_tz = datetime.now(
|
||||
ZoneInfo(self.time_zone) if not isinstance(self.time_zone, ZoneInfo) else self.time_zone
|
||||
ZoneInfo(self.time_zone) if isinstance(self.time_zone, str) else self.time_zone
|
||||
)
|
||||
except ZoneInfoNotFoundError as e:
|
||||
raise ValueError(f'Zone could not be loaded [{self.time_zone}]: {e}') from e
|
||||
|
||||
Reference in New Issue
Block a user