Source

WebObTestCoverage / _test_mlk.py

Full commit
import sys, site, os, tempfile

testenv_dir = os.path.join(tempfile.gettempdir(), 'webob-testenv')
if not os.path.exists(testenv_dir):
    os.makedirs(testenv_dir)
    from setuptools.command.easy_install import main
    site.USER_SITE = testenv_dir
    libs = 'nose dtopt webtest mext.test>=0.4.2 coverage'.split()
    main(['-x', '-N', '-d', testenv_dir] + libs)

site.addsitedir(testenv_dir)

from mext.test_suite import TestSuite
suite = TestSuite('tests', coverage=True, pkg='webob')

doctests = ['test_dec', 'test_request', 'test_response']
doctests += map('../docs/'.__add__, ['do-it-yourself', 'file-example', 'index', 'reference'])
map(suite.add_doctest, doctests)
suite.add_unittest('test_multidict')
map(suite.add_nosetest, [
    'test_request', 'test_response', 'test_headers',
    'test_cookies', 'test_exc',
    'test_misc', 'test_datetime_utils',
])


if __name__ == '__main__':
    suite.run_text()