##// END OF EJS Templates
Test case for the failure to compile code including unicode characters.
Test case for the failure to compile code including unicode characters.

File last commit:

r3443:a8652504
r3443:a8652504
Show More
unicode_tests.py
18 lines | 581 B | text/x-python | PythonLexer
# coding: utf-8
"""These tests have to be run separately from the main test suite (iptest),
because that sets the default encoding to utf-8, and it cannot be changed after
the interpreter is up and running. The default encoding in a Python 2.x
environment is ASCII."""
import unittest, sys
from IPython.core import compilerop
assert sys.getdefaultencoding() == "ascii"
class CompileropTest(unittest.TestCase):
def test_accept_unicode(self):
cp = compilerop.CachingCompiler()
cp(u"t = 'žćčšđ'", "single")
if __name__ == "__main__":
unittest.main()