summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2015-11-06 15:10:44 -0800
committerJeff Forcier <jeff@bitprophet.org>2015-11-06 15:10:44 -0800
commita90f247a27eadae138eff5ee78c91c99dbc3596f (patch)
tree6edb76311b5bd476dcc39766bf43a764c0b8c106 /tests
parent1258d9e1bb856ef14ee18ad4bcd52c31cf9f268c (diff)
Hacky cleanup of non-gc'd clients in a loopy test.
Re #612
Diffstat (limited to 'tests')
-rw-r--r--tests/test_client.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index 04cab439..f71efd5a 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -193,12 +193,18 @@ class SSHClientTest (unittest.TestCase):
(['dss', 'rsa', 'ecdsa'], ['dss']), # Try ECDSA but fail
(['rsa', 'ecdsa'], ['ecdsa']), # ECDSA success
):
- self._test_connection(
- key_filename=[
- test_path('test_{0}.key'.format(x)) for x in attempt
- ],
- allowed_keys=[types_[x] for x in accept],
- )
+ try:
+ self._test_connection(
+ key_filename=[
+ test_path('test_{0}.key'.format(x)) for x in attempt
+ ],
+ allowed_keys=[types_[x] for x in accept],
+ )
+ finally:
+ # Clean up to avoid occasional gc-related deadlocks.
+ # TODO: use nose test generators after nose port
+ self.tearDown()
+ self.setUp()
def test_multiple_key_files_failure(self):
"""