summaryrefslogtreecommitdiff
path: root/psutil/tests/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'psutil/tests/__main__.py')
-rwxr-xr-xpsutil/tests/__main__.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/psutil/tests/__main__.py b/psutil/tests/__main__.py
index 896b00cc..475e6b81 100755
--- a/psutil/tests/__main__.py
+++ b/psutil/tests/__main__.py
@@ -21,8 +21,7 @@ try:
except ImportError:
from urllib2 import urlopen
-from psutil.tests import unittest
-from psutil.tests import VERBOSITY
+from psutil.tests import run_suite
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -73,24 +72,6 @@ def install_test_deps(deps=None):
return code
-def get_suite():
- testmodules = [os.path.splitext(x)[0] for x in os.listdir(HERE)
- if x.endswith('.py') and x.startswith('test_') and not
- x.startswith('test_memory_leaks')]
- suite = unittest.TestSuite()
- for tm in testmodules:
- # ...so that the full test paths are printed on screen
- tm = "psutil.tests.%s" % tm
- suite.addTest(unittest.defaultTestLoader.loadTestsFromName(tm))
- return suite
-
-
-def run_suite():
- result = unittest.TextTestRunner(verbosity=VERBOSITY).run(get_suite())
- success = result.wasSuccessful()
- sys.exit(0 if success else 1)
-
-
def main():
usage = "%s -m psutil.tests [opts]" % PYTHON
parser = optparse.OptionParser(usage=usage, description="run unit tests")