diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2013-05-25 00:04:32 -0400 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2013-05-25 00:04:32 -0400 |
commit | 1a716ed46d1d556d4ba6798608ab498320acd886 (patch) | |
tree | dbcb23de26387e312f7ea09085330eca90e15853 /test.py | |
parent | a88b8c8c0f591a3bfa8d7984343a27815184f495 (diff) | |
download | python-paramiko-1a716ed46d1d556d4ba6798608ab498320acd886.tar python-paramiko-1a716ed46d1d556d4ba6798608ab498320acd886.tar.gz |
Imported Upstream version 1.10.1upstream/1.10.1
Diffstat (limited to 'test.py')
-rwxr-xr-x | test.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -28,6 +28,7 @@ import sys import unittest from optparse import OptionParser import paramiko +import threading sys.path.append('tests') @@ -141,7 +142,15 @@ def main(): if len(args) > 0: filter = '|'.join(args) suite = filter_suite_by_re(suite, filter) - runner.run(suite) + result = runner.run(suite) + # Clean up stale threads from poorly cleaned-up tests. + # TODO: make that not a problem, jeez + for thread in threading.enumerate(): + if thread is not threading.currentThread(): + thread._Thread__stop() + # Exit correctly + if not result.wasSuccessful(): + sys.exit(1) if __name__ == '__main__': |