]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/sample_doctest.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / sample_doctest.py
CommitLineData
4710c53d 1"""This is a sample module that doesn't really test anything all that\r
2 interesting.\r
3\r
4It simply has a few tests, some of which succeed and some of which fail.\r
5\r
6It's important that the numbers remain constant as another test is\r
7testing the running of these tests.\r
8\r
9\r
10>>> 2+2\r
114\r
12"""\r
13\r
14\r
15def foo():\r
16 """\r
17\r
18 >>> 2+2\r
19 5\r
20\r
21 >>> 2+2\r
22 4\r
23 """\r
24\r
25def bar():\r
26 """\r
27\r
28 >>> 2+2\r
29 4\r
30 """\r
31\r
32def test_silly_setup():\r
33 """\r
34\r
35 >>> import test.test_doctest\r
36 >>> test.test_doctest.sillySetup\r
37 True\r
38 """\r
39\r
40def w_blank():\r
41 """\r
42 >>> if 1:\r
43 ... print 'a'\r
44 ... print\r
45 ... print 'b'\r
46 a\r
47 <BLANKLINE>\r
48 b\r
49 """\r
50\r
51x = 1\r
52def x_is_one():\r
53 """\r
54 >>> x\r
55 1\r
56 """\r
57\r
58def y_is_one():\r
59 """\r
60 >>> y\r
61 1\r
62 """\r
63\r
64__test__ = {'good': """\r
65 >>> 42\r
66 42\r
67 """,\r
68 'bad': """\r
69 >>> 42\r
70 666\r
71 """,\r
72 }\r
73\r
74def test_suite():\r
75 import doctest\r
76 return doctest.DocTestSuite()\r