##// 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 484 leading_indent(),
485 485 classic_prompt(),
486 486 ipy_prompt(),
487 strip_encoding_cookie(),
488 487 cellmagic(end_on_blank_line=line_input_checker),
488 strip_encoding_cookie(),
489 489 ]
490 490
491 491 self.assemble_logical_lines = assemble_logical_lines()
@@ -496,7 +496,7 b' class IPythonInputTestCase(InputSplitterTestCase):'
496 496 if __name__ == '__main__':
497 497 # A simple demo for interactive experimentation. This code will not get
498 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 501 # configure here the syntax to use, prompt and whether to autoindent
502 502 #isp, start_prompt = InputSplitter(), '>>> '
@@ -592,6 +592,16 b' class CellModeCellMagics(CellMagicsCommon, unittest.TestCase):'
592 592 sp.push('\n')
593 593 # This should accept a blank line and carry on until the cell is reset
594 594 nt.assert_true(sp.push_accepts_more()) #3
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
595 605
596 606 class LineModeCellMagics(CellMagicsCommon, unittest.TestCase):
597 607 sp = isp.IPythonInputSplitter(line_input_checker=True)
General Comments 0
You need to be logged in to leave comments. Login now