Skip to content

Commit

Permalink
Modernize a test that sometimes fails for no obvious reason on travis…
Browse files Browse the repository at this point in the history
… only =/
  • Loading branch information
bitprophet committed Dec 3, 2019
1 parent 9292ef2 commit 4066f59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,15 @@ def test_cleanup(self):

self.tc = SSHClient()
self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())
self.assertEqual(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)
self.assertTrue(self.event.is_set())
self.assertTrue(self.ts.is_active())
assert self.event.is_set()
assert self.ts.is_active()

p = weakref.ref(self.tc._transport.packetizer)
self.assertTrue(p() is not None)
assert p() is not None
self.tc.close()
del self.tc

Expand All @@ -425,7 +425,7 @@ def test_cleanup(self):
gc.collect()
gc.collect()

self.assertTrue(p() is None)
assert p() is None

def test_client_can_be_used_as_context_manager(self):
"""
Expand Down

0 comments on commit 4066f59

Please sign in to comment.