File: __init__.py

package info (click to toggle)
python-fastrlock 0.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: python: 642; makefile: 69; ansic: 5
file content (20 lines) | stat: -rw-r--r-- 574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

def suite():
    import unittest
    import doctest
    import os
    test_dir = os.path.abspath(os.path.dirname(__file__))

    tests = []
    for filename in os.listdir(test_dir):
        if filename.endswith('.py') and not filename.startswith('_'):
            tests.append(unittest.defaultTestLoader.loadTestsFromName(__name__ + '.' + filename[:-3]))

    suite = unittest.TestSuite(tests) if len(tests) != 1 else tests[0]
    suite.addTest(doctest.DocFileSuite('../../README.rst'))
    return suite


if __name__ == '__main__':
    import unittest
    unittest.main()