##// END OF EJS Templates
Add some extra tests for prefiltering.
Fernando Perez -
Show More
@@ -10,6 +10,8 b' from IPython.testing import tools as tt, decorators as dec'
10 #-----------------------------------------------------------------------------
10 #-----------------------------------------------------------------------------
11 # Tests
11 # Tests
12 #-----------------------------------------------------------------------------
12 #-----------------------------------------------------------------------------
13 ip = get_ipython()
14
13 @dec.parametric
15 @dec.parametric
14 def test_prefilter():
16 def test_prefilter():
15 """Test user input conversions"""
17 """Test user input conversions"""
@@ -29,6 +31,21 b' def test_prefilter():'
29 ' print i,'),
31 ' print i,'),
30 ]
32 ]
31
33
32 ip = get_ipython()
33 for raw, correct in pairs:
34 for raw, correct in pairs:
34 yield nt.assert_equals(ip.prefilter(raw), correct)
35 yield nt.assert_equals(ip.prefilter(raw), correct)
36
37
38 @dec.parametric
39 def test_autocall_binops():
40 """See https://bugs.launchpad.net/ipython/+bug/315706"""
41 ip.magic('autocall 2')
42 f = lambda x: x
43 ip.user_ns['f'] = f
44 try:
45 yield nt.assert_equals(ip.prefilter('f 1'),'f(1)')
46 for t in ['f +1', 'f -1']:
47 yield nt.assert_equals(ip.prefilter(t), t)
48 finally:
49 ip.magic('autocall 0')
50 del ip.user_ns['f']
51
General Comments 0
You need to be logged in to leave comments. Login now