diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-04-24 19:38:21 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-04-24 19:38:21 +0200 |
commit | 1da757c4408911dae34a707b7a63df89cc530727 (patch) | |
tree | 586bcea3fa996e9644d0bab88b4336eae9cbbd82 /psutil/tests/runner.py | |
parent | 1d6df8d52530c6143dcd0260bbcfd384d1315c8f (diff) | |
download | psutil-1018-test-refactoring.tar.gz |
#1018: enable 'python -m psutil.tests' to run tests1018-test-refactoring
Diffstat (limited to 'psutil/tests/runner.py')
-rwxr-xr-x | psutil/tests/runner.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/psutil/tests/runner.py b/psutil/tests/runner.py deleted file mode 100755 index 88bcd620..00000000 --- a/psutil/tests/runner.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2007-2016 Giampaolo Rodola' <g.rodola@gmail.com>. -# Use of this source code is governed by MIT license that can be -# found in the LICENSE file. - -"""Script for running all test files (except memory leaks tests).""" - -import os -import sys - -from psutil.tests import unittest -from psutil.tests import VERBOSITY - - -def get_suite(): - HERE = os.path.abspath(os.path.dirname(__file__)) - 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 "make test" will print the full test paths - tm = "psutil.tests.%s" % tm - suite.addTest(unittest.defaultTestLoader.loadTestsFromName(tm)) - return suite - - -def main(): - # run tests - result = unittest.TextTestRunner(verbosity=VERBOSITY).run(get_suite()) - success = result.wasSuccessful() - sys.exit(0 if success else 1) - - -if __name__ == '__main__': - main() |