Ignore:
Timestamp:
12/29/08 12:24:05 (5 years ago)
Author:
xi
Message:

Added basic support for Python 3 (Thanks idadesub(at)users(dot)sourceforge(dot)net).

Location:
pyyaml/trunk/tests3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/tests3/test_resolver.py

    r322 r328  
    77    node = None 
    88    try: 
    9         correct_tag = open(detect_filename, 'rb').read().strip() 
     9        correct_tag = open(detect_filename, 'r').read().strip() 
    1010        node = yaml.compose(open(data_filename, 'rb')) 
    1111        assert isinstance(node, yaml.SequenceNode), node 
     
    1515    finally: 
    1616        if verbose: 
    17             print "CORRECT TAG:", correct_tag 
     17            print("CORRECT TAG:", correct_tag) 
    1818            if hasattr(node, 'value'): 
    19                 print "CHILDREN:" 
     19                print("CHILDREN:") 
    2020                pprint.pprint(node.value) 
    2121 
     
    3030        pass 
    3131 
    32     yaml.add_path_resolver(u'!root', [], 
     32    yaml.add_path_resolver('!root', [], 
    3333            Loader=MyLoader, Dumper=MyDumper) 
    34     yaml.add_path_resolver(u'!root/scalar', [], str, 
     34    yaml.add_path_resolver('!root/scalar', [], str, 
    3535            Loader=MyLoader, Dumper=MyDumper) 
    36     yaml.add_path_resolver(u'!root/key11/key12/*', ['key11', 'key12'], 
     36    yaml.add_path_resolver('!root/key11/key12/*', ['key11', 'key12'], 
    3737            Loader=MyLoader, Dumper=MyDumper) 
    38     yaml.add_path_resolver(u'!root/key21/1/*', ['key21', 1], 
     38    yaml.add_path_resolver('!root/key21/1/*', ['key21', 1], 
    3939            Loader=MyLoader, Dumper=MyDumper) 
    40     yaml.add_path_resolver(u'!root/key31/*/*/key14/map', ['key31', None, None, 'key14'], dict, 
     40    yaml.add_path_resolver('!root/key31/*/*/key14/map', ['key31', None, None, 'key14'], dict, 
    4141            Loader=MyLoader, Dumper=MyDumper) 
    4242 
     
    6868    finally: 
    6969        if verbose: 
    70             print yaml.serialize_all(nodes1) 
     70            print(yaml.serialize_all(nodes1)) 
    7171 
    7272test_path_resolver_loader.unittest = ['.data', '.path'] 
     
    7777        output = yaml.serialize_all(yaml.compose_all(open(filename, 'rb')), Dumper=MyDumper) 
    7878        if verbose: 
    79             print output 
     79            print(output) 
    8080        nodes1 = yaml.compose_all(output) 
    8181        nodes2 = yaml.compose_all(open(data_filename, 'rb')) 
Note: See TracChangeset for help on using the changeset viewer.