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

Method test_show_caches

Lib/test/test_dis.py:1435–1449  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1433
1434 @cpython_only
1435 def test_show_caches(self):
1436 for quickened in (False, True):
1437 for adaptive in (False, True):
1438 with self.subTest(f"{quickened=}, {adaptive=}"):
1439 if adaptive:
1440 pattern = r"^(\w+: \d+)?$"
1441 else:
1442 pattern = r"^(\w+: 0)?$"
1443 caches = list(self.get_cached_values(quickened, adaptive))
1444 for cache in caches:
1445 self.assertRegex(cache, pattern)
1446 total_caches = 22
1447 empty_caches = 7
1448 self.assertEqual(caches.count(""), empty_caches)
1449 self.assertEqual(len(caches), total_caches)
1450
1451 @cpython_only
1452 def test_show_currinstr_with_cache(self):

Callers

nothing calls this directly

Calls 6

get_cached_valuesMethod · 0.95
listClass · 0.85
assertRegexMethod · 0.80
subTestMethod · 0.45
assertEqualMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected