##// END OF EJS Templates
Refine unicode tests for ultratb
Thomas Kluyver -
Show More
@@ -6,6 +6,7 b' import os.path'
6 6 import unittest
7 7
8 8 from IPython.testing import tools as tt
9 from IPython.testing.decorators import onlyif_unicode_paths
9 10 from IPython.utils.syspathcontext import prepended_to_syspath
10 11 from IPython.utils.tempdir import TemporaryDirectory
11 12
@@ -59,9 +60,22 b' def fail():'
59 60 '''
60 61
61 62 class NonAsciiTest(unittest.TestCase):
62 def test_iso8859_5(self):
63 @onlyif_unicode_paths
64 def test_nonascii_path(self):
63 65 # Non-ascii directory name as well.
64 66 with TemporaryDirectory(suffix=u'é') as td:
67 fname = os.path.join(td, u"fooé.py")
68 with open(fname, "w") as f:
69 f.write(file_1)
70
71 with prepended_to_syspath(td):
72 ip.run_cell("import foo")
73
74 with tt.AssertPrints("ZeroDivisionError"):
75 ip.run_cell("foo.f()")
76
77 def test_iso8859_5(self):
78 with TemporaryDirectory() as td:
65 79 fname = os.path.join(td, 'dfghjkl.py')
66 80
67 81 with io.open(fname, 'w', encoding='iso-8859-5') as f:
General Comments 0
You need to be logged in to leave comments. Login now