##// END OF EJS Templates
Use better temp file for onlyif_unicode_paths test.
Thomas Kluyver -
Show More
@@ -1,3 +1,4 b''
1 # -*- coding: utf-8 -*-
1 """Decorators for labeling test objects.
2 """Decorators for labeling test objects.
2
3
3 Decorators that merely return a modified version of the original function
4 Decorators that merely return a modified version of the original function
@@ -323,11 +324,12 b' null_deco = lambda f: f'
323 # Some tests only run where we can use unicode paths. Note that we can't just
324 # Some tests only run where we can use unicode paths. Note that we can't just
324 # check os.path.supports_unicode_filenames, which is always False on Linux.
325 # check os.path.supports_unicode_filenames, which is always False on Linux.
325 try:
326 try:
326 tempfile.mkdtemp(u"€")
327 f = tempfile.NamedTemporaryFile(prefix=u"tmp€")
327 except UnicodeEncodeError:
328 except UnicodeEncodeError:
328 unicode_paths = False
329 unicode_paths = False
329 else:
330 else:
330 unicode_paths = True
331 unicode_paths = True
332 f.close()
331
333
332 onlyif_unicode_paths = onlyif(unicode_paths, ("This test is only applicable "
334 onlyif_unicode_paths = onlyif(unicode_paths, ("This test is only applicable "
333 "where we can use unicode in filenames."))
335 "where we can use unicode in filenames."))
General Comments 0
You need to be logged in to leave comments. Login now