diff --git a/kivy/tests/test_filechooser_unicode.py b/kivy/tests/test_filechooser_unicode.py index 961086147..af132d341 100644 --- a/kivy/tests/test_filechooser_unicode.py +++ b/kivy/tests/test_filechooser_unicode.py @@ -3,6 +3,7 @@ import unittest import logging from kivy.compat import PY2 +from kivy import platform if PY2: unicode_char = unichr @@ -13,6 +14,14 @@ else: class FileChooserUnicodeTestCase(unittest.TestCase): def setUp(self): + self.skip_test = platform == 'macosx' or platform == 'ios' + # on mac, files ending in \uffff etc. simply are changed so don't + # do any tests because we cannot predict the real filenames that will + # be created. If it works on win and linux it also works on mac. + # note filechooser should still work, it's only the test that fail + # because we have to create file ourselves. + if self.skip_test: + return import os from os.path import join from zipfile import ZipFile @@ -54,6 +63,8 @@ class FileChooserUnicodeTestCase(unittest.TestCase): open(f, 'rb').close() def test_filechooserlistview_unicode(self): + if self.skip_test: + return from kivy.uix.filechooser import FileChooserListView from kivy.clock import Clock from os.path import join @@ -75,6 +86,8 @@ class FileChooserUnicodeTestCase(unittest.TestCase): self.assertIn(f, files) def tearDown(self): + if self.skip_test: + return from os import remove, rmdir try: for f in self.ufiles: