From 1d33faa410a274be7d4ad26d4137c947c41ecdc4 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 14 Jun 2019 14:33:27 -0400 Subject: Update to modern pytest(-relaxed) Also fix some low hanging warnings fruit --- tests/test_client.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests/test_client.py') diff --git a/tests/test_client.py b/tests/test_client.py index 03b163fc..7d431384 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -277,15 +277,13 @@ class SSHClientTest(unittest.TestCase): os.close(fd) client = paramiko.SSHClient() - self.assertEquals(0, len(client.get_host_keys())) + assert len(client.get_host_keys()) == 0 host_id = "[%s]:%d" % (self.addr, self.port) client.get_host_keys().add(host_id, "ssh-rsa", public_host_key) - self.assertEquals(1, len(client.get_host_keys())) - self.assertEquals( - public_host_key, client.get_host_keys()[host_id]["ssh-rsa"] - ) + assert len(client.get_host_keys()) == 1 + assert public_host_key == client.get_host_keys()[host_id]["ssh-rsa"] client.save_host_keys(localname) @@ -336,7 +334,7 @@ class SSHClientTest(unittest.TestCase): with paramiko.SSHClient() as tc: self.tc = tc self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - self.assertEquals(0, len(self.tc.get_host_keys())) + assert len(self.tc.get_host_keys()) == 0 self.tc.connect(**dict(self.connect_kwargs, password="pygmalion")) self.event.wait(1.0) -- cgit v1.2.3