Skip to content

Commit

Permalink
Remove system-dependent doctests, we'll test this another way.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgasch committed Nov 3, 2024
1 parent 41e7446 commit fdcfaa4
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/pyutils/datetimes/datetime_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,11 @@ def timezone_abbrev_to_canonical_name(
return None


def timezone_abbrev_to_tz(
abbrev: str, country_code: Optional[str] = "US"
) -> Union[pytz.tzinfo.DstTzInfo, pytz.tzinfo.StaticTzInfo, None,]:
def timezone_abbrev_to_tz(abbrev: str, country_code: Optional[str] = "US") -> Union[
pytz.tzinfo.DstTzInfo,
pytz.tzinfo.StaticTzInfo,
None,
]:
"""Given a timezone abbreviation and optional country code, return a
timezone from pytz that cooresponds to the given abbreviation.
Expand All @@ -569,17 +571,6 @@ def timezone_abbrev_to_tz(
timezones. To override this, pass an explicit country_code
instead of relying on the default.
>>> timezone_abbrev_to_tz('EST')
<StaticTzInfo 'EST'>
>>> timezone_abbrev_to_tz('CST')
<DstTzInfo 'America/Chicago' LMT-1 day, 18:09:00 STD>
>>> timezone_abbrev_to_tz('CST', 'CN')
<DstTzInfo 'Asia/Shanghai' LMT+8:06:00 STD>
>>> timezone_abbrev_to_tz('xyzzy')
"""

# First try with the requested country_code.
Expand Down

0 comments on commit fdcfaa4

Please sign in to comment.