Show More
@@ -133,3 +133,16 b' class InteractiveShellTestCase(unittest.TestCase):' | |||||
133 | finally: |
|
133 | finally: | |
134 | # Reset compiler flags so we don't mess up other tests. |
|
134 | # Reset compiler flags so we don't mess up other tests. | |
135 | ip.compile.reset_compiler_flags() |
|
135 | ip.compile.reset_compiler_flags() | |
|
136 | ||||
|
137 | def test_future_unicode(self): | |||
|
138 | """Check that unicode_literals is imported from __future__ (gh #786)""" | |||
|
139 | ip = get_ipython() | |||
|
140 | try: | |||
|
141 | ip.run_cell(u'len_byte_str = len("\xe9")') | |||
|
142 | assert ip.user_ns['len_byte_str'] == 2 | |||
|
143 | ip.run_cell('from __future__ import unicode_literals') | |||
|
144 | ip.run_cell(u'len_unicode_str = len("\xe9")') | |||
|
145 | assert ip.user_ns['len_unicode_str'] == 1 | |||
|
146 | finally: | |||
|
147 | # Reset compiler flags so we don't mess up other tests. | |||
|
148 | ip.compile.reset_compiler_flags() |
General Comments 0
You need to be logged in to leave comments.
Login now