MCPcopy Create free account
hub / github.com/dateutil/dateutil / tzpath_and_outside_zone

Function tzpath_and_outside_zone

tests/test_tzfile.py:1572–1590  ·  view source on GitHub ↗

A TZPATH entry, and a zone in a sibling directory outside of it.

(tmp_path)

Source from the content-addressed store, hash-verified

1570
1571@pytest.fixture
1572def tzpath_and_outside_zone(tmp_path):
1573 """A TZPATH entry, and a zone in a sibling directory outside of it."""
1574 STD = ZoneOffset("STD", ZERO)
1575 data = construct_zone(
1576 [ZoneTransition(datetime(2020, 1, 1), STD, STD)], "STD0"
1577 ).read()
1578
1579 tzpath = tmp_path / "zoneinfo"
1580 outside = tmp_path / "outside"
1581 for directory in (tzpath / "Fictional", outside):
1582 os.makedirs(str(directory))
1583
1584 (tzpath / "Fictional" / "Inside").write_bytes(data)
1585 (outside / "Outside").write_bytes(data)
1586
1587 with set_tzpath((str(tzpath),), block_tzdata=True):
1588 tz.gettz.cache_clear()
1589 yield
1590 tz.gettz.cache_clear()
1591
1592
1593@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 6

ZoneOffsetClass · 0.85
construct_zoneFunction · 0.85
ZoneTransitionClass · 0.85
set_tzpathFunction · 0.85
cache_clearMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected