Commits

Amaury Forgeot d'Arc committed df3792c

Fix test on Linux

Comments (0)

Files changed (1)

pypy/rlib/test/test_rposix.py

 
     def test_listdir(self):
         udir = UnicodeWithEncoding(os.path.dirname(self.ufilename))
-        def f():
-            return u', '.join(rposix.listdir(udir))
 
-        result = interpret(f, [])
-        assert os.path.basename(self.ufilename) in ll_to_string(result)
+        if sys.platform == 'win32':
+            def f():
+                return u', '.join(rposix.listdir(udir))
+            result = interpret(f, [])
+            assert os.path.basename(self.ufilename) in ll_to_string(result)
+        else:
+            def f():
+                return ', '.join(rposix.listdir(udir))
+            result = interpret(f, [])
+            assert (os.path.basename(self.ufilename).encode('utf-8') in
+                    ll_to_string(result))
 
     def test_chdir(self):
         os.unlink(self.ufilename)