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

memory/gctransform/test/test_framework.py::test_custom_trace_function_no_collect

def test_custom_trace_function_no_collect():
        from rpython.rlib import rgc
        from rpython.translator.c.genc import CStandaloneBuilder
    
        S = lltype.GcStruct("MyStructure")
        class Glob:
            pass
        glob = Glob()
        def trace_func(gc, obj, callback, arg1, arg2):
            glob.foo = (gc, obj)
        lambda_trace_func = lambda: trace_func
        def entrypoint(argv):
            lltype.malloc(S)
            rgc.register_custom_trace_hook(S, lambda_trace_func)
            return 0
    
        def run_rtyper(fn):
            t = rtype(fn, [s_list_of_strings])
            t.config.translation.gc = "minimark"
            cbuild = CStandaloneBuilder(t, fn, t.config,
                                        gcpolicy=FrameworkGcPolicy2)
            cbuild.make_entrypoint_wrapper = False
            cbuild.build_database()
            return True
    
        with py.test.raises(Exception) as f:
            run_rtyper(entrypoint)
>       assert 'can cause the GC to be called' in str(f.value)
E       assert 'can cause the GC to be called' in "Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)"
E        +  where "Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)" = str(SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-.../build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)))
E        +    where SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-.../build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-.../build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None))
E        +      where SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/rpython-linux-x86-.../build_dir/rpython-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) = <ExceptionInfo SyntaxError tblen=8>.value

memory/gctransform/test/test_framework.py:177: AssertionError
---------- Captured stderr call ----------
[rtyper] -=- specialized 4 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 25 more blocks -=-
builder: rpython-linux-x86-32 build #832
test: memory/gctransform/test/test_framework/py/test_custom_trace_function_no_collect