Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 417045
Collapse All | Expand All

(-)src/manuel/tests.py (-4 / +7 lines)
Lines 9-24 Link Here
9
import os.path
9
import os.path
10
import re
10
import re
11
import unittest
11
import unittest
12
import zope.testing.renormalizing
13
12
14
doctest = manuel.absolute_import('doctest')
13
doctest = manuel.absolute_import('doctest')
15
14
16
here = os.path.dirname(os.path.abspath(__file__))
15
here = os.path.dirname(os.path.abspath(__file__))
17
16
18
checker = zope.testing.renormalizing.RENormalizing([
17
try:
18
    checker = zope.testing.renormalizing.RENormalizing([
19
    (re.compile(r"<unittest\.result\.TestResult"), '<unittest.TestResult'),
19
    (re.compile(r"<unittest\.result\.TestResult"), '<unittest.TestResult'),
20
    ])
20
    ])
21
21
except:
22
    pass
22
23
23
def turtle_on_the_bottom_test():
24
def turtle_on_the_bottom_test():
24
    """We use manuel to test itself.
25
    """We use manuel to test itself.
Lines 52-58 Link Here
52
    optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
53
    optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
53
54
54
    m = manuel.ignore.Manuel()
55
    m = manuel.ignore.Manuel()
55
    m += manuel.doctest.Manuel(optionflags=optionflags, checker=checker)
56
    m += manuel.codeblock.Manuel()
56
    m += manuel.codeblock.Manuel()
57
    m += manuel.capture.Manuel()
57
    m += manuel.capture.Manuel()
58
    m += manuel.testcase.SectionManuel()
58
    m += manuel.testcase.SectionManuel()
Lines 66-68 Link Here
66
        suite,
66
        suite,
67
        doctest.DocTestSuite(),
67
        doctest.DocTestSuite(),
68
        ))
68
        ))
69
70
if __name__ == '__main__':
71
    unittest.TextTestRunner().run(test_suite())
(-)manuel-1.6.0.orig/src/manuel/index.txt (-7 / +7 lines)
Lines 166-181 Link Here
166
.. code-block:: python
166
.. code-block:: python
167
     import os.path
167
    import os.path
168
     import manuel.testing
168
    import manuel.testing
169
     class StripDirsTestCase(manuel.testing.TestCase):
169
    class StripDirsTestCase(manuel.testing.TestCase):
170
         def shortDescription(self):
170
        def shortDescription(self):
171
             return os.path.basename(str(self))
171
             return os.path.basename(str(self))
172
     suite = manuel.testing.TestSuite(
172
    suite = manuel.testing.TestSuite(
173
         m, path_to_test, TestCase=StripDirsTestCase)
173
        m, path_to_test, TestCase=StripDirsTestCase)
174
    >>> list(suite)[0].shortDescription()
174
    list(suite)[0].shortDescription()
175
    'bugs.txt'
175
    'bugs.txt'

Return to bug 417045