(loader, tests, ignore)
| 29 | |
| 30 | |
| 31 | def load_tests(loader, tests, ignore): |
| 32 | # The 'merge' function has examples in its docstring which we should test |
| 33 | # with 'doctest'. |
| 34 | # |
| 35 | # However, doctest can't easily find all docstrings in the module (loading |
| 36 | # it through import_fresh_module seems to confuse it), so we specifically |
| 37 | # create a finder which returns the doctests from the merge method. |
| 38 | |
| 39 | class HeapqMergeDocTestFinder: |
| 40 | def find(self, *args, **kwargs): |
| 41 | dtf = doctest.DocTestFinder() |
| 42 | return dtf.find(py_heapq.merge) |
| 43 | |
| 44 | tests.addTests(doctest.DocTestSuite(py_heapq, |
| 45 | test_finder=HeapqMergeDocTestFinder())) |
| 46 | return tests |
| 47 | |
| 48 | class TestHeap: |
| 49 |
nothing calls this directly
no test coverage detected
searching dependent graphs…