Commits

Amaury Forgeot d'Arc  committed 99fcff9

on tannit32, sys.getfilesystemencoding() is 'ascii' :-(
Skip tests when the filename cannot be encoded.

  • Participants
  • Parent commits 05d83ee
  • Branches unicode_filename-2

Comments (0)

Files changed (3)

File pypy/module/_file/test/test_file.py

         f.close()
 
     def test_unicode_filename(self):
+        import sys
+        try:
+            u'\xe9'.encode(sys.getfilesystemencoding())
+        except UnicodeEncodeError:
+            skip("encoding not good enough")
         f = self.file(self.temppath + u'\xe9', "w")
         f.close()
 

File pypy/module/posix/test/test_posix2.py

     def setup_class(cls):
         ufilename = (unicode(udir.join('test_unicode_filename_')) +
                      u'\u65e5\u672c.txt') # "Japan"
-        f = file(ufilename, 'w')
+        try:
+            f = file(ufilename, 'w')
+        except UnicodeEncodeError:
+            py.test.skip("encoding not good enough")
         f.write("test")
         f.close()
         cls.space = space

File pypy/rlib/test/test_rposix.py

 from pypy.tool.udir import udir
 from pypy.rlib import rposix
 import os, sys
+import py
 
 def ll_to_string(s):
     return ''.join(s.chars)
     def setup_method(self, method):
         self.ufilename = (unicode(udir.join('test_open')) +
                           u'\u65e5\u672c.txt') # "Japan"
-        f = file(self.ufilename, 'w')
+        try:
+            f = file(self.ufilename, 'w')
+        except UnicodeEncodeError:
+            py.test.skip("encoding not good enough")
         f.write("test")
         f.close()