Show More
@@ -1,24 +1,24 b'' | |||||
1 | ===================================== |
|
1 | ===================================== | |
2 | Tests in example form - pure python |
|
2 | Tests in example form - pure python | |
3 | ===================================== |
|
3 | ===================================== | |
4 |
|
4 | |||
5 | This file contains doctest examples embedded as code blocks, using normal |
|
5 | This file contains doctest examples embedded as code blocks, using normal | |
6 | Python prompts. See the accompanying file for similar examples using IPython |
|
6 | Python prompts. See the accompanying file for similar examples using IPython | |
7 | prompts (you can't mix both types within one file). The following will be run |
|
7 | prompts (you can't mix both types within one file). The following will be run | |
8 | as a test:: |
|
8 | as a test:: | |
9 |
|
9 | |||
10 | >>> 1+1 |
|
10 | >>> 1+1 | |
11 | 2 |
|
11 | 2 | |
12 | >>> print "hello" |
|
12 | >>> print ("hello") | |
13 | hello |
|
13 | hello | |
14 |
|
14 | |||
15 | More than one example works:: |
|
15 | More than one example works:: | |
16 |
|
16 | |||
17 | >>> s="Hello World" |
|
17 | >>> s="Hello World" | |
18 |
|
18 | |||
19 | >>> s.upper() |
|
19 | >>> s.upper() | |
20 | 'HELLO WORLD' |
|
20 | 'HELLO WORLD' | |
21 |
|
21 | |||
22 | but you should note that the *entire* test file is considered to be a single |
|
22 | but you should note that the *entire* test file is considered to be a single | |
23 | test. Individual code blocks that fail are printed separately as ``example |
|
23 | test. Individual code blocks that fail are printed separately as ``example | |
24 | failures``, but the whole file is still counted and reported as one test. |
|
24 | failures``, but the whole file is still counted and reported as one test. |
General Comments 0
You need to be logged in to leave comments.
Login now