summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest.py
diff options
context:
space:
mode:
authorJim Fulton <jim@zope.com>2004-08-28 15:22:12 (GMT)
committerJim Fulton <jim@zope.com>2004-08-28 15:22:12 (GMT)
commitfafd874bc8ae89a9c145e38d94cb14e628fcad34 (patch)
tree9fd466bb271a31a7535103ca73fabcac140de6c0 /Lib/test/test_unittest.py
parent9f556a408bfc0ea872cc2efbd86534ef46c5f42c (diff)
downloadcpython-fafd874bc8ae89a9c145e38d94cb14e628fcad34.zip
cpython-fafd874bc8ae89a9c145e38d94cb14e628fcad34.tar.gz
cpython-fafd874bc8ae89a9c145e38d94cb14e628fcad34.tar.bz2
Added an __iter__ method for test suites.
Diffstat (limited to 'Lib/test/test_unittest.py')
-rw-r--r--Lib/test/test_unittest.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
new file mode 100644
index 0000000..9151166
--- /dev/null
+++ b/Lib/test/test_unittest.py
@@ -0,0 +1,31 @@
+"""Test script for unittest.
+
+This just includes tests for new features. We really need a
+full set of tests.
+"""
+
+import unittest
+
+def test_TestSuite_iter():
+ """
+ >>> test1 = unittest.FunctionTestCase(lambda: None)
+ >>> test2 = unittest.FunctionTestCase(lambda: None)
+ >>> suite = unittest.TestSuite((test1, test2))
+ >>> tests = []
+ >>> for test in suite:
+ ... tests.append(test)
+ >>> tests == [test1, test2]
+ True
+ """
+
+
+######################################################################
+## Main
+######################################################################
+
+def test_main():
+ from test import test_support, test_unittest
+ test_support.run_doctest(test_unittest, verbosity=True)
+
+if __name__ == '__main__':
+ test_main()