summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-06-09 13:56:15 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-06-09 13:56:15 -0700
commitdb536221784e281d5452bf0d6346e2d2a86affbd (patch)
tree0599cd77475b6a0f93eb73cf6bec2e71b3c523ae /tests/test_client.py
parentf5c558eaa7072cfe753564f5fbef2bd34748e6ca (diff)
parent22439d24a7a304cf6f9e2f97b934000f5908664e (diff)
Merge branch '2.0' into 976-int
Diffstat (limited to 'tests/test_client.py')
-rw-r--r--tests/test_client.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index 9c5761d6..bfdf5f81 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -35,7 +35,7 @@ import time
from tests.util import test_path
import paramiko
-from paramiko.common import PY2
+from paramiko.py3compat import PY2, b
from paramiko.ssh_exception import SSHException
@@ -280,13 +280,10 @@ class SSHClientTest (unittest.TestCase):
verify that when an SSHClient is collected, its transport (and the
transport's packetizer) is closed.
"""
- # Unclear why this is borked on Py3, but it is, and does not seem worth
- # pursuing at the moment. Skipped on PyPy because it fails on travis
- # for unknown reasons, works fine locally.
- # XXX: It's the release of the references to e.g packetizer that fails
- # in py3...
- if not PY2 or platform.python_implementation() == "PyPy":
+ # Skipped on PyPy because it fails on travis for unknown reasons
+ if platform.python_implementation() == "PyPy":
return
+
threading.Thread(target=self._run).start()
self.tc = paramiko.SSHClient()
@@ -304,8 +301,8 @@ class SSHClientTest (unittest.TestCase):
del self.tc
# force a collection to see whether the SSHClient object is deallocated
- # correctly. 2 GCs are needed to make sure it's really collected on
- # PyPy
+ # 2 GCs are needed on PyPy, time is needed for Python 3
+ time.sleep(0.3)
gc.collect()
gc.collect()