Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some tests not closing all threads #2301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ def sftp_server():
# Make & yield connection.
tc.connect(username="slowdive", password="pygmalion")
yield tc
# TODO: any need for shutdown? Why didn't old suite do so? Or was that the
# point of the "join all threads from threading module" crap in test.py?
# Shutdown both transports to prevent lingering threads.
tc.close()
ts.close()


@pytest.fixture
Expand Down
4 changes: 4 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def test_certs_allowed_as_key_filename_values(self):
key_filename=key_path,
public_blob=PublicBlob.from_file(f"{key_path}-cert.pub"),
)
# Transport needs to be closed after each iteration.
self.tc.close()

@requires_sha1_signing
def test_certs_implicitly_loaded_alongside_key_filename_keys(self):
Expand All @@ -348,6 +350,8 @@ def test_certs_implicitly_loaded_alongside_key_filename_keys(self):
key_filename=key_path,
public_blob=PublicBlob.from_file(f"{key_path}-cert.pub"),
)
# Transport needs to be closed after each iteration.
self.tc.close()

def _cert_algo_test(self, ver, alg):
# Issue #2017; see auth_handler.py
Expand Down