Changeset 331 for pyyaml/trunk/tests

Show
Ignore:
Timestamp:
12/29/08 18:21:43 (3 years ago)
Author:
xi
Message:

Use Cython if available; added Python 3 support to _yaml.pyx.

Location:
pyyaml/trunk/tests/lib3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/tests/lib3/test_structure.py

    r330 r331  
    140140        def construct_mapping(self, node): 
    141141            pairs = self.construct_pairs(node) 
    142             pairs.sort() 
     142            pairs.sort(key=(lambda i: str(i))) 
    143143            return pairs 
    144144        def construct_undefined(self, node): 
     
    156156        def construct_mapping(self, node): 
    157157            pairs = self.construct_pairs(node) 
    158             pairs.sort() 
     158            pairs.sort(key=(lambda i: str(i))) 
    159159            return pairs 
    160160        def construct_undefined(self, node): 
  • pyyaml/trunk/tests/lib3/test_yaml_ext.py

    r330 r331  
    253253        if not isinstance(collection, dict): 
    254254            collection = vars(collection) 
    255         keys = collection.keys() 
    256         keys.sort() 
    257         for key in keys: 
     255        for key in sorted(collection): 
    258256            value = collection[key] 
    259257            if isinstance(value, types.FunctionType) and hasattr(value, 'unittest'): 
    260258                functions.append(wrap_ext_function(value)) 
    261259    for function in functions: 
    262         assert function.unittest_name not in globals() 
    263         globals()[function.unittest_name] = function 
     260        assert function.__name__ not in globals() 
     261        globals()[function.__name__] = function 
    264262 
    265263import test_tokens, test_structure, test_errors, test_resolver, test_constructor,   \