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

Function test_gettz_set_cache_size

tests/test_tz.py:1197–1214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1195
1196@pytest.mark.gettz
1197def test_gettz_set_cache_size():
1198 tz.gettz.cache_clear()
1199 tz.gettz.set_cache_size(3)
1200
1201 PARIS_ref = weakref.ref(tz.gettz("Europe/Paris"))
1202 EASTER_ref = weakref.ref(tz.gettz("Pacific/Easter"))
1203 HOBART_ref = weakref.ref(tz.gettz("Australia/Hobart"))
1204
1205 gc.collect()
1206
1207 assert PARIS_ref() is not None
1208 assert EASTER_ref() is not None
1209 assert HOBART_ref() is not None
1210
1211 tz.gettz.set_cache_size(2)
1212 gc.collect()
1213
1214 assert PARIS_ref() is None
1215
1216@pytest.mark.smoke
1217@pytest.mark.gettz

Callers

nothing calls this directly

Calls 3

cache_clearMethod · 0.80
set_cache_sizeMethod · 0.80
gettzMethod · 0.45

Tested by

no test coverage detected