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