--- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,7 +2,6 @@ invoke>=2.0 invocations>=3.2 # Testing! -pytest-relaxed>=2 # pytest-xdist for test dir watching and the inv guard task pytest-xdist>=3 # Linting! --- a/tests/test_client.py +++ b/tests/test_client.py @@ -33,7 +33,6 @@ import weakref from tempfile import mkstemp import pytest -from pytest_relaxed import raises from unittest.mock import patch, Mock import paramiko @@ -799,11 +798,11 @@ class PasswordPassphraseTests(ClientTest # TODO: more granular exception pending #387; should be signaling "no auth # methods available" because no key and no password - @raises(SSHException) @requires_sha1_signing def test_passphrase_kwarg_not_used_for_password_auth(self): - # Using the "right" password in the "wrong" field shouldn't work. - self._test_connection(passphrase="pygmalion") + with pytest.raises(SSHException): + # Using the "right" password in the "wrong" field shouldn't work. + self._test_connection(passphrase="pygmalion") @requires_sha1_signing def test_passphrase_kwarg_used_for_key_passphrase(self): @@ -823,15 +822,15 @@ class PasswordPassphraseTests(ClientTest password="television", ) - @raises(AuthenticationException) # TODO: more granular @requires_sha1_signing def test_password_kwarg_not_used_for_passphrase_when_passphrase_kwarg_given( # noqa self, ): # Sanity: if we're given both fields, the password field is NOT used as # a passphrase. - self._test_connection( - key_filename=_support("test_rsa_password.key"), - password="television", - passphrase="wat? lol no", - ) + with pytest.raises(AuthenticationException): + self._test_connection( + key_filename=_support("test_rsa_password.key"), + password="television", + passphrase="wat? lol no", + )