Changeset 5356:f7f50b249af3 in livinglogic.python.xist

Show
Ignore:
Timestamp:
02/19/13 12:20:05 (6 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Remove prints in UL4 test functions. They no longer provide any additional information.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_ul4.py

    r5355 r5356  
    4848    """ 
    4949    template = ul4c.Template(__, keepws=keepws) 
    50     f = sys._getframe(1) 
    51     print("Testing Python template ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    52     print(template) 
    53     print("with variables:") 
    54     print(repr(variables)) 
    5550    return template.renders(**variables) 
    5651 
     
    6459    template = ul4c.Template(__, keepws=keepws) 
    6560    template = ul4c.Template.loads(template.dumps()) # Recreate the template from the binary dump 
    66     f = sys._getframe(1) 
    67     print("Testing Python template loaded from string ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    68     print(template) 
    69     print("with variables:") 
    70     print(repr(variables)) 
    7161    return template.renders(**variables) 
    7262 
     
    8171    template.dump(stream) 
    8272    stream.seek(0) 
    83     f = sys._getframe(1) 
    8473    template = ul4c.Template.load(stream) # Recreate the template from the stream 
    85     print("Testing Python template loaded from stream ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    86     print(template) 
    87     print("with variables:") 
    88     print(repr(variables)) 
    8974    return template.renders(**variables) 
    9075 
     
    10085    js = template.jssource() 
    10186    js = "template = {};\ndata = {};\nprint(template.renders(data));\n".format(js, ul4c._asjson(variables)) 
    102     f = sys._getframe(1) 
    103     print("Testing Javascript template compiled by Python ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    104     print(js) 
    10587    with tempfile.NamedTemporaryFile(mode="wb", suffix=".js") as f: 
    10688        f.write(js.encode("utf-8")) 
     
    127109    print $template->renders($variables); 
    128110    ?>""".format(phpexpr(template.dumps()), phpexpr(variables)) 
    129     f = sys._getframe(1) 
    130     print("Testing PHP template compiled by Python ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    131     print(php) 
    132111    with tempfile.NamedTemporaryFile(mode="wb", suffix=".php") as f: 
    133112        f.write(php.encode("utf-8")) 
     
    241220        source = maincodetemplate % dict(source=source) 
    242221        source = java_formatsource(source) 
    243         print(source) 
    244222        with open(os.path.join(tempdir, "UL4Test.java"), "wb") as f: 
    245223            f.write(source.encode("utf-8")) 
     
    281259    """ 
    282260 
    283     f = sys._getframe(1) 
    284     print("Testing Java InterpretedTemplate (compiled by Python) ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    285261    templatesource = ul4c.Template(__, keepws=keepws).javasource() 
    286262    java = codetemplate % dict(variables=misc.javaexpr(variables), template=templatesource) 
     
    306282    """ 
    307283 
    308     f = sys._getframe(1) 
    309     print("Testing Java InterpretedTemplate (compiled by Java) ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    310284    java = codetemplate % dict(source=misc.javaexpr(__), variables=misc.javaexpr(variables), keepws=misc.javaexpr(keepws)) 
    311285    return java_runsource(java) 
     
    317291    """ 
    318292    template = ul4c.Template(__, keepws=keepws) 
    319     f = sys._getframe(1) 
    320     print("Testing Python template ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    321     print(template) 
    322     print("with variables:") 
    323     print(repr(variables)) 
    324293    return template(**variables) 
    325294 
     
    333302    template = ul4c.Template(__, keepws=keepws) 
    334303    template = ul4c.Template.loads(template.dumps()) # Recreate the template from the binary dump 
    335     f = sys._getframe(1) 
    336     print("Testing Python template loaded from string ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    337     print(template) 
    338     print("with variables:") 
    339     print(repr(variables)) 
    340304    return template(**variables) 
    341305 
     
    351315    template.dump(stream) 
    352316    stream.seek(0) 
    353     f = sys._getframe(1) 
    354317    template = ul4c.Template.load(stream) # Recreate the template from the stream 
    355     print("Testing Python template loaded from stream ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    356     print(template) 
    357     print("with variables:") 
    358     print(repr(variables)) 
    359318    return template(**variables) 
    360319 
     
    370329    js = template.jssource() 
    371330    js = "template = {};\ndata = {};\nprint(ul4on.dumps(template.call(data)));\n".format(js, ul4c._asjson(variables)) 
    372     f = sys._getframe(1) 
    373     print("Testing Javascript template compiled by Python ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    374     print(js) 
    375331    with tempfile.NamedTemporaryFile(mode="wb", suffix=".js") as f: 
    376332        f.write(js.encode("utf-8")) 
     
    408364    """ 
    409365 
    410     f = sys._getframe(1) 
    411     print("Testing Java InterpretedTemplate (compiled by Python) ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    412366    templatesource = ul4c.Template(__, keepws=keepws).javasource() 
    413367    java = codetemplate % dict(variables=misc.javaexpr(variables), template=templatesource) 
     
    433387    """ 
    434388 
    435     f = sys._getframe(1) 
    436     print("Testing Java InterpretedTemplate (compiled by Java) ({}, line {}):".format(f.f_code.co_filename, f.f_lineno)) 
    437389    java = codetemplate % dict(source=misc.javaexpr(__), variables=misc.javaexpr(variables), keepws=misc.javaexpr(keepws)) 
    438390    return ul4on.loads(java_runsource(java))