From 978b652cc4385f7706c49f3391bf2d91e93d4b18 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Fri, 2 Jun 2017 03:18:00 -0400 Subject: re-enable client cleanup test for python3 --- tests/test_client.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests/test_client.py') diff --git a/tests/test_client.py b/tests/test_client.py index 9c5761d6..f2f2ea45 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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() -- cgit v1.2.3 From 02b0aef5932438c2dd0b7d649a6e61450fb71be3 Mon Sep 17 00:00:00 2001 From: Martin Packman Date: Thu, 25 May 2017 22:13:01 +0100 Subject: Import from py3compat directly in test_client --- tests/test_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_client.py') diff --git a/tests/test_client.py b/tests/test_client.py index f2f2ea45..38006df0 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.common import PY2, b from paramiko.ssh_exception import SSHException -- cgit v1.2.3 From dd0524c2dc07892022ff187b156e10fa1f1c1716 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 9 Jun 2017 13:50:54 -0700 Subject: Flake8/etc tweaks re #971 in 2.x --- paramiko/common.py | 4 +--- paramiko/sftp_client.py | 4 +--- tests/test_client.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'tests/test_client.py') diff --git a/paramiko/common.py b/paramiko/common.py index 8ce735d7..0012372a 100644 --- a/paramiko/common.py +++ b/paramiko/common.py @@ -20,9 +20,7 @@ Common constants and global variables. """ import logging -from paramiko.py3compat import ( - byte_chr, PY2, bytes_types, text_type, string_types, b, long, -) +from paramiko.py3compat import byte_chr, PY2, bytes_types, text_type, long MSG_DISCONNECT, MSG_IGNORE, MSG_UNIMPLEMENTED, MSG_DEBUG, \ MSG_SERVICE_REQUEST, MSG_SERVICE_ACCEPT = range(1, 7) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index a1ee6723..ee5ab073 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -28,9 +28,7 @@ from paramiko import util from paramiko.channel import Channel from paramiko.message import Message from paramiko.common import INFO, DEBUG, o777 -from paramiko.py3compat import ( - bytestring, b, u, long, string_types, bytes_types, -) +from paramiko.py3compat import bytestring, b, u, long from paramiko.sftp import ( BaseSFTP, CMD_OPENDIR, CMD_HANDLE, SFTPError, CMD_READDIR, CMD_NAME, CMD_CLOSE, SFTP_FLAG_READ, SFTP_FLAG_WRITE, SFTP_FLAG_CREATE, diff --git a/tests/test_client.py b/tests/test_client.py index 38006df0..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, b +from paramiko.py3compat import PY2, b from paramiko.ssh_exception import SSHException -- cgit v1.2.3