Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions pandas/_testing/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ def set_timezone(tz: str) -> Generator[None, None, None]:
import time

def setTZ(tz) -> None:
if tz is None:
try:
del os.environ["TZ"]
except KeyError:
pass
else:
os.environ["TZ"] = tz
time.tzset()
if hasattr(time, "tzset"):
if tz is None:
try:
del os.environ["TZ"]
except KeyError:
pass
else:
os.environ["TZ"] = tz
time.tzset()

orig_tz = os.environ.get("TZ")
setTZ(tz)
Expand Down
11 changes: 7 additions & 4 deletions pandas/tests/tslibs/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
)
def test_parsing_tzlocal_deprecated():
# GH#50791
msg = (
r"Parsing 'EST' as tzlocal \(dependent on system timezone\) "
r"is no longer supported\. "
"Pass the 'tz' keyword or call tz_localize after construction instead"
msg = "|".join(
[
r"Parsing 'EST' as tzlocal \(dependent on system timezone\) "
r"is no longer supported\. "
"Pass the 'tz' keyword or call tz_localize after construction instead",
".*included an un-recognized timezone",
]
)
dtstr = "Jan 15 2004 03:00 EST"

Expand Down