17
17
self.log.append(('method', method))
20
class TestFinder(unittest.TestCase):
20
class TestPassiveFinder(unittest.TestCase):
21
"""One approach to finding tests is to look inside a module for test
22
classes and then look inside those test classes for test methods. The
23
default finder uses this approach.
23
self.finder = MockFinder()
27
self.collector = MockCollector()
25
29
def test_empty(self):
26
30
from testdoc.tests import empty
27
find_tests(self.finder, empty)
28
self.assertEqual(self.finder.log, [('module', empty)])
31
find_tests(self.collector, empty)
32
self.assertEqual(self.collector.log, [('module', empty)])
30
34
def test_hasemptycase(self):
31
35
from testdoc.tests import hasemptycase
32
find_tests(self.finder, hasemptycase)
36
find_tests(self.collector, hasemptycase)
35
39
('module', hasemptycase),
36
40
('class', hasemptycase.SomeTest)])
38
42
def test_hastests(self):
39
43
from testdoc.tests import hastests
40
find_tests(self.finder, hastests)
44
find_tests(self.collector, hastests)
43
47
('module', hastests),
44
48
('class', hastests.SomeTest),
45
49
('method', hastests.SomeTest.test_foo_handles_qux),