The key is the string passed to gettz whichever source supplied it.
(source, zoneinfo_cache)
| 2313 | @pytest.mark.parametrize("zoneinfo_cache", ["fat"], indirect=True) |
| 2314 | @pytest.mark.parametrize("source", ["tzdata", "tzpath"]) |
| 2315 | def test_gettz_key_attribute_by_source(source, zoneinfo_cache): |
| 2316 | """The key is the string passed to gettz whichever source supplied it.""" |
| 2317 | if source == "tzdata": |
| 2318 | pytest.importorskip("tzdata") |
| 2319 | paths = () |
| 2320 | else: |
| 2321 | paths = (zoneinfo_cache[0],) |
| 2322 | |
| 2323 | with set_tzpath(paths, block_tzdata=(source != "tzdata")): |
| 2324 | tz.gettz.cache_clear() |
| 2325 | for key in ("America/New_York", "Europe/London"): |
| 2326 | zone = tz.gettz(key) |
| 2327 | assert isinstance(zone, tz.tzfile) |
| 2328 | assert zone.key == key |
| 2329 | |
| 2330 | |
| 2331 | @pytest.mark.parametrize("zoneinfo_cache", ["fat"], indirect=True) |
nothing calls this directly
no test coverage detected