##// END OF EJS Templates
Restore some functionality of the sphinx directive....
Restore some functionality of the sphinx directive. See #11362 The issue is in 2 part, before IPython 7.0 the input splitter was state full, this was (in part) due to readline. The second part is that because of this, we had to be a bit adressive of what was considered complete code (it had to have 2 new line). This is now not required anymore as we can submit stuff as a whole. I hope that this fixes that. I have another fix in mind that count (and reset) the number of consecutive blank line, but that will be more complicated end code.

File last commit:

r23044:7e78dda8
r24710:73f493f5
Show More
test_prompts.py
34 lines | 918 B | text/x-python | PythonLexer
MinRK
add failing test for unicode cwd in prompts
r7570 # -*- coding: utf-8
Thomas Kluyver
Add tests for prompt system.
r5658 """Tests for prompt generation."""
import unittest
Thomas Kluyver
Remove PromptManager class...
r22425 from IPython.core.prompts import LazyEvaluate
Thomas Kluyver
Add tests for prompt system.
r5658 from IPython.testing.globalipapp import get_ipython
ip = get_ipython()
class PromptTests(unittest.TestCase):
MinRK
test LazyEvaluate with non-ascii input
r7577 def test_lazy_eval_unicode(self):
u = u'ünicødé'
lz = LazyEvaluate(lambda : u)
Srinivas Reddy Thatiparthy
remove unicode_type function
r23044 self.assertEqual(str(lz), u)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(format(lz), u)
MinRK
test LazyEvaluate with non-ascii input
r7577
def test_lazy_eval_nonascii_bytes(self):
u = u'ünicødé'
b = u.encode('utf8')
lz = LazyEvaluate(lambda : b)
MinRK
use cleaner, less safe, unicode/str in LazyEvaluate
r7581 # unicode(lz) would fail
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(str(lz), str(b))
self.assertEqual(format(lz), str(b))
MinRK
test LazyEval with float and format string
r7579
def test_lazy_eval_float(self):
f = 0.503
lz = LazyEvaluate(lambda : f)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(str(lz), str(f))
self.assertEqual(format(lz), str(f))
self.assertEqual(format(lz, '.1'), '0.5')
Aaron Meurer
Be a little smarter about invisible characters in terminal prompts...
r21605