Lines Matching refs:unittest
1 import unittest
6 from unittest.test.support import LoggingResult, TestEquality
13 class Foo(unittest.TestCase):
20 return unittest.TestSuite(Test.Foo(n) for n in names)
25 class Test_TestSuite(unittest.TestCase, TestEquality):
31 eq_pairs = [(unittest.TestSuite(), unittest.TestSuite())
32 ,(unittest.TestSuite(), unittest.TestSuite([]))
36 ne_pairs = [(unittest.TestSuite(), _mk_TestSuite('test_1'))
37 ,(unittest.TestSuite([]), _mk_TestSuite('test_1'))
51 suite = unittest.TestSuite()
55 suite.run(unittest.TestResult())
66 suite = unittest.TestSuite([])
70 suite.run(unittest.TestResult())
81 yield unittest.FunctionTestCase(lambda: None)
82 yield unittest.FunctionTestCase(lambda: None)
84 suite_1 = unittest.TestSuite(tests())
87 suite_2 = unittest.TestSuite(suite_1)
90 suite_3 = unittest.TestSuite(set(suite_1))
94 suite_1.run(unittest.TestResult())
96 suite_2.run(unittest.TestResult())
98 suite_3.run(unittest.TestResult())
110 ftc = unittest.FunctionTestCase(lambda: None)
111 yield unittest.TestSuite([ftc])
112 yield unittest.FunctionTestCase(lambda: None)
114 suite = unittest.TestSuite(tests())
117 suite.run(unittest.TestResult())
125 test1 = unittest.FunctionTestCase(lambda: None)
126 test2 = unittest.FunctionTestCase(lambda: None)
127 suite = unittest.TestSuite((test1, test2))
137 suite = unittest.TestSuite()
148 class Test1(unittest.TestCase):
152 suite = unittest.TestSuite([unittest.TestSuite()])
160 test1 = unittest.FunctionTestCase(lambda: None)
161 test2 = unittest.FunctionTestCase(lambda: None)
162 suite = unittest.TestSuite((test1, test2))
166 suite.run(unittest.TestResult())
175 class Test1(unittest.TestCase):
179 test2 = unittest.FunctionTestCase(lambda: None)
180 test3 = unittest.FunctionTestCase(lambda: None)
181 child = unittest.TestSuite((Test1('test2'), test2))
182 parent = unittest.TestSuite((test3, child, Test1('test1')))
186 parent.run(unittest.TestResult())
198 suite = unittest.TestSuite()
207 suite = unittest.TestSuite()
222 class LoggingCase(unittest.TestCase):
231 unittest.TestSuite(tests).run(result)
237 class Foo(unittest.TestCase):
241 suite = unittest.TestSuite()
248 suite.run(unittest.TestResult())
253 class Foo(unittest.TestCase):
256 suite_2 = unittest.TestSuite([Foo('test')])
258 suite = unittest.TestSuite()
264 suite.run(unittest.TestResult())
273 class Foo(unittest.TestCase):
279 inner_suite = unittest.TestSuite([test_2])
286 suite_1 = unittest.TestSuite()
293 suite_2 = unittest.TestSuite()
304 suite = unittest.TestSuite()
314 suite = unittest.TestSuite()
318 suite = unittest.TestSuite()
320 self.assertRaises(TypeError, suite.addTest, unittest.TestSuite)
323 suite = unittest.TestSuite()
329 suite = unittest.TestSuite()
333 suite.run(unittest.TestResult())
336 if not unittest.BaseTestSuite._cleanup:
337 raise unittest.SkipTest("Suite cleanup is disabled")
339 suite = unittest.TestSuite()
347 if not unittest.BaseTestSuite._cleanup:
348 raise unittest.SkipTest("Suite cleanup is disabled")
350 suite = unittest.TestSuite()
357 if not unittest.BaseTestSuite._cleanup:
358 raise unittest.SkipTest("Suite cleanup is disabled")
360 class Foo(unittest.TestCase):
368 suite.run(unittest.TestResult())
379 self.assert_garbage_collect_test_after_run(unittest.BaseTestSuite)
382 self.assert_garbage_collect_test_after_run(unittest.TestSuite)
385 class Test(unittest.TestCase):
412 suite = unittest.BaseTestSuite()
416 result = unittest.TestResult()
429 class MySuite(unittest.TestSuite):
433 unittest.TestSuite.__call__(self, *args, **kw)
436 result = unittest.TestResult()
437 wrapper = unittest.TestSuite()
447 unittest.main()