File: runner.py

package info (click to toggle)
python-psutil 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,804 kB
  • ctags: 2,615
  • sloc: ansic: 12,394; python: 12,237; makefile: 339
file content (27 lines) | stat: -rwxr-xr-x 921 bytes parent folder | download
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
26
27
#!/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


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))
result = unittest.TextTestRunner(verbosity=VERBOSITY).run(suite)
success = result.wasSuccessful()
sys.exit(0 if success else 1)