Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_mutate_class_int

self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x00000000102d29f8>

    def test_mutate_class_int(self):
        def fn(n):
            class A(object):
                count = 1
                def __init__(self, a):
                    self.a = a
                def f(self):
                    return self.count
            i = 0
            a = A(1)
            while i < n:
                A.count += 1 # ID: mutate
                i = a.f()    # ID: meth1
            return i
        #
        log = self.run(fn, [1000], threshold=10)
        assert log.result == 1000
        #
        # first, we test the entry bridge
        # -------------------------------
        entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
        ops = entry_bridge.ops_by_id('mutate', opcode='LOAD_ATTR')
        assert log.opnames(ops) == ['guard_value',
                                    'guard_not_invalidated',
>                                   'getfield_gc_i']
E       assert ['getfield_gc_i'] == ['guard_value', 'gua...ed', 'getfield_gc_i']
E         At index 0 diff: 'getfield_gc_i' != 'guard_value'
E         Right contains more items, first extra item: 'guard_not_invalidated'
E         Use -v to get the full diff

pypy/module/pypyjit/test_pypy_c/test_instance.py:112: AssertionError
builder: pypy-c-jit-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_mutate_class_int