summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_client.py')
-rw-r--r--tests/test_client.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index a8d04630..e6d10699 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -207,8 +207,14 @@ class SSHClientTest (unittest.TestCase):
self.assert_(p() is not None)
del self.tc
# hrm, sometimes p isn't cleared right away. why is that?
- st = time.time()
- while (time.time() - st < 5.0) and (p() is not None):
- time.sleep(0.1)
+ #st = time.time()
+ #while (time.time() - st < 5.0) and (p() is not None):
+ # time.sleep(0.1)
+
+ # instead of dumbly waiting for the GC to collect, force a collection
+ # to see whether the SSHClient object is deallocated correctly
+ import gc
+ gc.collect()
+
self.assert_(p() is None)