Show More
@@ -0,0 +1,43 b'' | |||
|
1 | """These kinds of tests are less than ideal, but at least they run. | |
|
2 | ||
|
3 | This was an old test that was being run interactively in the top-level tests/ | |
|
4 | directory, which we are removing. For now putting this here ensures at least | |
|
5 | we do run the test, though ultimately this functionality should all be tested | |
|
6 | with better-isolated tests that don't rely on the global instance in iptest. | |
|
7 | """ | |
|
8 | ||
|
9 | def doctest_autocall(): | |
|
10 | """ | |
|
11 | In [1]: def f1(a,b,c): | |
|
12 | ...: return a+b+c | |
|
13 | ...: | |
|
14 | ||
|
15 | In [2]: def f2(a): | |
|
16 | ...: return a + a | |
|
17 | ...: | |
|
18 | ||
|
19 | In [3]: ;f2 a b c | |
|
20 | Out[3]: 'a b ca b c' | |
|
21 | ||
|
22 | In [4]: assert _ == "a b ca b c" | |
|
23 | ||
|
24 | In [5]: ,f1 a b c | |
|
25 | Out[5]: 'abc' | |
|
26 | ||
|
27 | In [6]: assert _ == 'abc' | |
|
28 | ||
|
29 | In [7]: print _ | |
|
30 | abc | |
|
31 | ||
|
32 | In [8]: /f1 1,2,3 | |
|
33 | Out[8]: 6 | |
|
34 | ||
|
35 | In [9]: assert _ == 6 | |
|
36 | ||
|
37 | In [10]: /f2 4 | |
|
38 | Out[10]: 8 | |
|
39 | ||
|
40 | In [11]: assert _ == 8 | |
|
41 | ||
|
42 | In [11]: del f1, f2 | |
|
43 | """ |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now