summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-05-13 21:41:05 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-05-13 21:41:05 (GMT)
commit9cf210f3929bdcc513d2ba988a708bc69e9f4f41 (patch)
tree72eb16139af9bd6aa7d9288aa4d6262d2a75b6d8 /Lib/test
parent9ac6114dc9e2a8ddac0244d70e69a6feae498550 (diff)
downloadcpython-9cf210f3929bdcc513d2ba988a708bc69e9f4f41.zip
cpython-9cf210f3929bdcc513d2ba988a708bc69e9f4f41.tar.gz
cpython-9cf210f3929bdcc513d2ba988a708bc69e9f4f41.tar.bz2
Improve test feedback to troubleshoot issue #8423 on OS X.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pep277.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index b09329d..751db23 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -130,10 +130,14 @@ class UnicodeFileTests(unittest.TestCase):
if sys.platform == 'darwin':
files = set(normalize('NFD', file) for file in files)
for name in others:
- if sys.platform == 'darwin' and normalize('NFD', name) in files:
+ if sys.platform == 'darwin':
# Mac OS X decomposes Unicode names. See comment above.
- os.stat(name)
- continue
+ try:
+ os.stat(name)
+ if normalize('NFD', name) in files:
+ continue
+ except OSError:
+ pass
self._apply_failure(open, name, IOError)
self._apply_failure(os.stat, name, OSError)
self._apply_failure(os.chdir, name, OSError)
@@ -152,7 +156,16 @@ class UnicodeFileTests(unittest.TestCase):
sf0 = set(normalize('NFD', unicode(f)) for f in self.files)
f2 = [normalize('NFD', unicode(f)) for f in f2]
sf2 = set(os.path.join(unicode(test_support.TESTFN), f) for f in f2)
- self.assertEqual(sf0, sf2)
+ try:
+ self.assertEqual(sf0, sf2)
+ except self.failureException:
+ if sys.platform != 'darwin':
+ raise
+ # XXX Troubleshoot issue #8423
+ f2 = os.listdir(unicode(test_support.TESTFN,
+ sys.getfilesystemencoding()))
+ sf2 = set(os.path.join(unicode(test_support.TESTFN), f) for f in f2)
+ self.assertEqual(set(self.files), sf2)
self.assertEqual(len(f1), len(f2))
def test_rename(self):