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

Method test_cache_bounded

Lib/test/test_codecs.py:3912–3919  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3910
3911class CodecCacheTest(unittest.TestCase):
3912 def test_cache_bounded(self):
3913 for i in range(encodings._MAXCACHE + 1000):
3914 try:
3915 b'x'.decode(f'nonexist_{i}')
3916 except LookupError:
3917 pass
3918
3919 self.assertLessEqual(len(encodings._cache), encodings._MAXCACHE)
3920
3921
3922if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

assertLessEqualMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected