Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 64 lines (45 sloc) 1.46 KB
#!/usr/bin/env python
import os
import sys
import logging
import unittest
import distutils.core
from glob import glob
from os.path import splitext, basename, join as pjoin
def run_tests():
Find and run all tests in the tests/ directory.
Excludes live tests (tests/live_*).
testfiles = ['tests.test_overall']
exclude = ['', '']
for t in glob(pjoin('tests', '*.py')):
if True not in [t.endswith(ex) for ex in exclude]:
if basename(t).startswith('test_'):
testfiles.append('tests.%s' % splitext(basename(t))[0])
suites = []
for file in testfiles:
tests = unittest.TestSuite(suites)
runner = unittest.TextTestRunner(verbosity=2)
# Disable logging output
result =
return result
# Add a 'test' command for
class TestCommand(distutils.core.Command):
user_options = [ ]
def initialize_options(self):
self._dir = os.getcwd()
def finalize_options(self):
def run(self):
if __name__ == '__main__':
result = run_tests()
print("<tests %s ran='%s' errors='%s' fails='%s' success='%s' />" % (
result.testsRun, len(result.errors),
len(result.failures), result.wasSuccessful()))
Something went wrong with that request. Please try again.