File: test_docs.py

package info (click to toggle)
python-pyramid 1.6+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,112 kB
  • ctags: 8,169
  • sloc: python: 41,764; makefile: 111; sh: 17
file content (35 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import unittest

if 0:
    # no released version of manuel actually works with :lineno:
    # settings yet
    class ManuelDocsCase(unittest.TestCase):
        def __new__(self, test):
            return getattr(self, test)()

        @classmethod
        def test_docs(cls):
            import os
            import pkg_resources
            import manuel.testing
            import manuel.codeblock
            import manuel.capture
            import manuel.ignore
            m = manuel.ignore.Manuel()
            m += manuel.codeblock.Manuel()
            m += manuel.capture.Manuel()
            docs = []

            egg_path = pkg_resources.get_distribution('pyramid').location
            path = os.path.join(egg_path, 'docs')
            for root, dirs, files in os.walk(path):
                for ignore in ('.svn', '.build', '.hg', '.git', 'CVS'):
                    if ignore in dirs:
                        dirs.remove(ignore)

                for filename in files:
                    if filename.endswith('.rst'):
                        docs.append(os.path.join(root, filename))

            print(path)
            return manuel.testing.TestSuite(m, *docs)