Exceptions raised during renaming in rotating file handlers are now passed to handleE...
[python.git] / Lib / test / sample_doctest.py
blobe5adee0f6fd699bc5c06d7f27609403589605734
1 """This is a sample module that doesn't really test anything all that
2 interesting.
4 It simply has a few tests, some of which succeed and some of which fail.
6 It's important that the numbers remain constant as another test is
7 testing the running of these tests.
10 >>> 2+2
12 """
15 def foo():
16 """
18 >>> 2+2
21 >>> 2+2
23 """
25 def bar():
26 """
28 >>> 2+2
30 """
32 def test_silly_setup():
33 """
35 >>> import test.test_doctest
36 >>> test.test_doctest.sillySetup
37 True
38 """
40 def w_blank():
41 """
42 >>> if 1:
43 ... print 'a'
44 ... print
45 ... print 'b'
47 <BLANKLINE>
49 """
51 x = 1
52 def x_is_one():
53 """
54 >>> x
56 """
58 def y_is_one():
59 """
60 >>> y
62 """
64 __test__ = {'good': """
65 >>> 42
67 """,
68 'bad': """
69 >>> 42
70 666
71 """,
74 def test_suite():
75 import doctest
76 return doctest.DocTestSuite()