Changeset 328 for pyyaml/trunk/tests3/test_constructor.py
- Timestamp:
- 12/29/08 12:24:05 (4 years ago)
- Location:
- pyyaml/trunk/tests3
- Files:
-
- 1 edited
- 1 copied
-
. (copied) (copied from pyyaml/trunk/tests)
-
test_constructor.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/tests3/test_constructor.py
r325 r328 4 4 5 5 import datetime 6 try:7 set8 except NameError:9 from sets import Set as set10 6 import yaml.tokens 11 7 12 8 def execute(code): 13 exec code9 exec(code) 14 10 return value 15 11 … … 230 226 elif isinstance(data, datetime.datetime): 231 227 return repr(data.utctimetuple()) 232 elif isinstance(data, unicode):233 return data.encode('utf-8')234 228 elif isinstance(data, float) and data != data: 235 229 return '?' … … 252 246 pass 253 247 if verbose: 254 print "SERIALIZED NATIVE1:"255 print _serialize_value(native1)256 print "SERIALIZED NATIVE2:"257 print _serialize_value(native2)248 print("SERIALIZED NATIVE1:") 249 print(_serialize_value(native1)) 250 print("SERIALIZED NATIVE2:") 251 print(_serialize_value(native2)) 258 252 assert _serialize_value(native1) == _serialize_value(native2), (native1, native2) 259 253 finally: 260 254 if verbose: 261 print "NATIVE1:"255 print("NATIVE1:") 262 256 pprint.pprint(native1) 263 print "NATIVE2:"257 print("NATIVE2:") 264 258 pprint.pprint(native2) 265 259
Note: See TracChangeset
for help on using the changeset viewer.
