]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update test__opcode and _Py_GetSpecializationStats with recent specialization stat...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Wed, 11 Aug 2021 16:34:01 +0000 (17:34 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Aug 2021 16:34:01 +0000 (17:34 +0100)
Lib/test/test__opcode.py
Python/specialize.c

index f6d8c730645c19ce07e58ce5fc6c6fe1f73ff8af..6bbab539903ce6a89f542addbefe5ae039b60abf 100644 (file)
@@ -82,10 +82,12 @@ class SpecializationStatsTests(unittest.TestCase):
             self.assertCountEqual(stats.keys(), specialized_opcodes)
             self.assertCountEqual(
                 stats['load_attr'].keys(),
-                stat_names + ['fails'])
+                stat_names + ['specialization_failure_kinds'])
             for sn in stat_names:
                 self.assertIsInstance(stats['load_attr'][sn], int)
-            self.assertIsInstance(stats['load_attr']['specialization_failure_kinds'], tuple)
+            self.assertIsInstance(
+                stats['load_attr']['specialization_failure_kinds'],
+                tuple)
             for v in stats['load_attr']['specialization_failure_kinds']:
                 self.assertIsInstance(v, int)
 
index d0e45d70c08801963dc9edb5a1054a8233a4757c..f0d68f027d64648ca13dc14dbe473a16851d15a4 100644 (file)
@@ -122,6 +122,7 @@ _Py_GetSpecializationStats(void) {
     err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
     err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
     err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
+    err += add_stat_dict(stats, STORE_ATTR, "store_attr");
     if (err < 0) {
         Py_DECREF(stats);
         return NULL;