A TZPATH entry, and a zone in a sibling directory outside of it.
(tmp_path)
| 1570 | |
| 1571 | @pytest.fixture |
| 1572 | def 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( |
nothing calls this directly
no test coverage detected