File: __init__.py

package info (click to toggle)
pyicu 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,184 kB
  • ctags: 1,603
  • sloc: cpp: 18,870; python: 870; makefile: 87; sh: 14
file content (25 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (8)
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
# test package

import sys

if __name__ == "__main__":
    if sys.version_info >= (2, 7):
        import os, unittest

        def load_tests(loader, standard_tests, pattern):
            if pattern is None:
                pattern = 'test*.py'
            this_dir = os.path.dirname(__file__)
            package_tests = loader.discover(start_dir=this_dir, pattern=pattern)
            standard_tests.addTests(package_tests)
            return standard_tests

        unittest.main()
    else:
        print >>sys.stderr, 'Unit test discovery requires Python 2.7 or later'
        try:
            from pkg_resources import require
            with_setuptools = require('setuptools')[0].parsed_version
            print >>sys.stderr, "Use: 'python setup.py test' instead"
        except ImportError:
            pass