aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorJeremy T. Bouse <jbouse@debian.org>2013-05-25 00:04:32 -0400
committerJeremy T. Bouse <jbouse@debian.org>2013-05-25 00:04:32 -0400
commit1a716ed46d1d556d4ba6798608ab498320acd886 (patch)
treedbcb23de26387e312f7ea09085330eca90e15853 /test.py
parenta88b8c8c0f591a3bfa8d7984343a27815184f495 (diff)
downloadpython-paramiko-1a716ed46d1d556d4ba6798608ab498320acd886.tar
python-paramiko-1a716ed46d1d556d4ba6798608ab498320acd886.tar.gz
Imported Upstream version 1.10.1upstream/1.10.1
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test.py b/test.py
index c0e9d15..f3dd4d2 100755
--- a/test.py
+++ b/test.py
@@ -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__':