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

Method test_no_cache

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

Source from the content-addressed store, hash-verified

1708 self.assertIs(zi_rt, zi_rt2)
1709
1710 def test_no_cache(self):
1711 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1712 with self.subTest(proto=proto):
1713 zi_no_cache = self.klass.no_cache("Europe/Dublin")
1714
1715 pkl = pickle.dumps(zi_no_cache, protocol=proto)
1716 zi_rt = pickle.loads(pkl)
1717
1718 with self.subTest(test="Not the pickled object"):
1719 self.assertIsNot(zi_rt, zi_no_cache)
1720
1721 zi_rt2 = pickle.loads(pkl)
1722 with self.subTest(test="Not a second unpickled object"):
1723 self.assertIsNot(zi_rt, zi_rt2)
1724
1725 zi_cache = self.klass("Europe/Dublin")
1726 with self.subTest(test="Not a cached object"):
1727 self.assertIsNot(zi_rt, zi_cache)
1728
1729 def test_from_file(self):
1730 key = "Europe/Dublin"

Callers

nothing calls this directly

Calls 5

no_cacheMethod · 0.80
assertIsNotMethod · 0.80
subTestMethod · 0.45
dumpsMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected