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

Function test_tzpath_setting

tests/test_tzfile.py:589–600  ·  view source on GitHub ↗

Ensure that setting tz.TZPATH changes where `tz.gettz` searches.

(tmp_path)

Source from the content-addressed store, hash-verified

587
588
589def test_tzpath_setting(tmp_path):
590 """Ensure that setting tz.TZPATH changes where `tz.gettz` searches."""
591
592 with set_tzpath([tmp_path]):
593 _copy_resource_to(
594 "liliput_tzif", os.path.join(str(tmp_path), "Fictional", "Liliput")
595 )
596 tz.gettz.cache_clear()
597
598 fiction_land = tz.gettz("Fictional/Liliput")
599
600 assert fiction_land is not None
601
602
603@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

set_tzpathFunction · 0.85
_copy_resource_toFunction · 0.85
cache_clearMethod · 0.80
gettzMethod · 0.45

Tested by

no test coverage detected