##// END OF EJS Templates
Backport PR #8843: don't strip encoding cookie from cell magics...
Min RK -
Show More
@@ -484,8 +484,8 b' class IPythonInputSplitter(InputSplitter):'
484 leading_indent(),
484 leading_indent(),
485 classic_prompt(),
485 classic_prompt(),
486 ipy_prompt(),
486 ipy_prompt(),
487 strip_encoding_cookie(),
488 cellmagic(end_on_blank_line=line_input_checker),
487 cellmagic(end_on_blank_line=line_input_checker),
488 strip_encoding_cookie(),
489 ]
489 ]
490
490
491 self.assemble_logical_lines = assemble_logical_lines()
491 self.assemble_logical_lines = assemble_logical_lines()
@@ -496,7 +496,7 b' class IPythonInputTestCase(InputSplitterTestCase):'
496 if __name__ == '__main__':
496 if __name__ == '__main__':
497 # A simple demo for interactive experimentation. This code will not get
497 # A simple demo for interactive experimentation. This code will not get
498 # picked up by any test suite.
498 # picked up by any test suite.
499 from IPython.core.inputsplitter import InputSplitter, IPythonInputSplitter
499 from IPython.core.inputsplitter import IPythonInputSplitter
500
500
501 # configure here the syntax to use, prompt and whether to autoindent
501 # configure here the syntax to use, prompt and whether to autoindent
502 #isp, start_prompt = InputSplitter(), '>>> '
502 #isp, start_prompt = InputSplitter(), '>>> '
@@ -593,6 +593,16 b' class CellModeCellMagics(CellMagicsCommon, unittest.TestCase):'
593 # This should accept a blank line and carry on until the cell is reset
593 # This should accept a blank line and carry on until the cell is reset
594 nt.assert_true(sp.push_accepts_more()) #3
594 nt.assert_true(sp.push_accepts_more()) #3
595
595
596 def test_no_strip_coding(self):
597 src = '\n'.join([
598 '%%writefile foo.py',
599 '# coding: utf-8',
600 'print(u"üñîçø∂é")',
601 ])
602 out = self.sp.transform_cell(src)
603 nt.assert_in('# coding: utf-8', out)
604
605
596 class LineModeCellMagics(CellMagicsCommon, unittest.TestCase):
606 class LineModeCellMagics(CellMagicsCommon, unittest.TestCase):
597 sp = isp.IPythonInputSplitter(line_input_checker=True)
607 sp = isp.IPythonInputSplitter(line_input_checker=True)
598
608
General Comments 0
You need to be logged in to leave comments. Login now