]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/unittest/__init__.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / unittest / __init__.py
CommitLineData
4710c53d 1"""\r
2Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's\r
3Smalltalk testing framework.\r
4\r
5This module contains the core framework classes that form the basis of\r
6specific test cases and suites (TestCase, TestSuite etc.), and also a\r
7text-based utility class for running the tests and reporting the results\r
8 (TextTestRunner).\r
9\r
10Simple usage:\r
11\r
12 import unittest\r
13\r
14 class IntegerArithmenticTestCase(unittest.TestCase):\r
15 def testAdd(self): ## test method names begin 'test*'\r
16 self.assertEqual((1 + 2), 3)\r
17 self.assertEqual(0 + 1, 1)\r
18 def testMultiply(self):\r
19 self.assertEqual((0 * 10), 0)\r
20 self.assertEqual((5 * 8), 40)\r
21\r
22 if __name__ == '__main__':\r
23 unittest.main()\r
24\r
25Further information is available in the bundled documentation, and from\r
26\r
27 http://docs.python.org/library/unittest.html\r
28\r
29Copyright (c) 1999-2003 Steve Purcell\r
30Copyright (c) 2003-2010 Python Software Foundation\r
31This module is free software, and you may redistribute it and/or modify\r
32it under the same terms as Python itself, so long as this copyright message\r
33and disclaimer are retained in their original form.\r
34\r
35IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,\r
36SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF\r
37THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
38DAMAGE.\r
39\r
40THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT\r
41LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
42PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,\r
43AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,\r
44SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\r
45"""\r
46\r
47__all__ = ['TestResult', 'TestCase', 'TestSuite',\r
48 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',\r
49 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',\r
50 'expectedFailure', 'TextTestResult', 'installHandler',\r
51 'registerResult', 'removeResult', 'removeHandler']\r
52\r
53# Expose obsolete functions for backwards compatibility\r
54__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])\r
55\r
56__unittest = True\r
57\r
58from .result import TestResult\r
59from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,\r
60 skipUnless, expectedFailure)\r
61from .suite import BaseTestSuite, TestSuite\r
62from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,\r
63 findTestCases)\r
64from .main import TestProgram, main\r
65from .runner import TextTestRunner, TextTestResult\r
66from .signals import installHandler, registerResult, removeResult, removeHandler\r
67\r
68# deprecated\r
69_TextTestResult = TextTestResult\r