summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-06-09 14:29:08 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-06-09 14:29:08 -0700
commitddf9a1a49538945be9af38df2e96e22e98fb9488 (patch)
treeb81e06cf811a1a50126eb232524ae08ce5bd4eec /tests/test_client.py
parent4526052de13932e91edf43f5a4ccb97dbc69afe9 (diff)
parent7fe437366c88a2607ebf4adbd0186baca05a55ad (diff)
Merge branch '2.1' into 910-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 3adb9665..2288cf57 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
@@ -296,13 +296,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()
@@ -320,8 +317,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()