test_pep277: display the filename as ascii on failure
This commit is contained in:
parent
114b724a4b
commit
5c1808a1a8
|
@ -132,7 +132,10 @@ class UnicodeFileTests(unittest.TestCase):
|
||||||
for name in others:
|
for name in others:
|
||||||
if sys.platform == 'darwin' and normalize('NFD', name) in files:
|
if sys.platform == 'darwin' and normalize('NFD', name) in files:
|
||||||
# Mac OS X decomposes Unicode names. See comment above.
|
# Mac OS X decomposes Unicode names. See comment above.
|
||||||
os.stat(name)
|
try:
|
||||||
|
os.stat(name)
|
||||||
|
except OSError as err:
|
||||||
|
raise AssertionError("File %a doesn't exist" % name)
|
||||||
continue
|
continue
|
||||||
self._apply_failure(open, name, IOError)
|
self._apply_failure(open, name, IOError)
|
||||||
self._apply_failure(os.stat, name, OSError)
|
self._apply_failure(os.stat, name, OSError)
|
||||||
|
|
Loading…
Reference in New Issue