Source

pyyaml / tests / test_representer.py

Diff from to

tests/test_representer.py

 
 class TestRepresenterTypes(test_appliance.TestAppliance):
 
-    def _testTypes(self, test_name, data_filename, code_filename):
+    def _testTypesUnicode(self, test_name, data_filename, code_filename):
+        return self._testTypes(test_name, data_filename, code_filename, allow_unicode=True)
+
+    def _testTypes(self, test_name, data_filename, code_filename, allow_unicode=False):
         data1 = eval(file(code_filename, 'rb').read())
         data2 = None
         output = None
         try:
-            output = dump(data1, Dumper=MyDumper)
+            output = dump(data1, Dumper=MyDumper, allow_unicode=allow_unicode)
             data2 = load(output, Loader=MyLoader)
             self.failUnlessEqual(type(data1), type(data2))
             try:
             raise
 
 TestRepresenterTypes.add_tests('testTypes', '.data', '.code')
+TestRepresenterTypes.add_tests('testTypesUnicode', '.data', '.code')