MCPcopy Index your code
hub / github.com/python/cpython / test_cache_miss

Method test_cache_miss

Lib/test/test_zoneinfo/test_zoneinfo.py:1697–1708  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1695 self.assertIs(zi_rt, zi_rt2)
1696
1697 def test_cache_miss(self):
1698 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1699 with self.subTest(proto=proto):
1700 zi_in = self.klass("Europe/Dublin")
1701 pkl = pickle.dumps(zi_in, protocol=proto)
1702
1703 del zi_in
1704 self.klass.clear_cache() # Induce a cache miss
1705 zi_rt = pickle.loads(pkl)
1706 zi_rt2 = pickle.loads(pkl)
1707
1708 self.assertIs(zi_rt, zi_rt2)
1709
1710 def test_no_cache(self):
1711 for proto in range(pickle.HIGHEST_PROTOCOL + 1):

Callers

nothing calls this directly

Calls 5

subTestMethod · 0.45
dumpsMethod · 0.45
clear_cacheMethod · 0.45
loadsMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected