mirror of
https://github.com/python/cpython.git
synced 2024-12-04 07:15:09 +08:00
19397e5ec5
This primarily adds more powerful ways to work with unittest, including spiffy support for building suites out of doctests in non-Python "text files".
18 lines
296 B
Plaintext
18 lines
296 B
Plaintext
This is a sample doctest in a text file.
|
|
|
|
In this example, we'll rely on a global variable being set for us
|
|
already:
|
|
|
|
>>> favorite_color
|
|
'blue'
|
|
|
|
We can make this fail by disabling the blank-line feature.
|
|
|
|
>>> if 1:
|
|
... print 'a'
|
|
... print
|
|
... print 'b'
|
|
a
|
|
<BLANKLINE>
|
|
b
|