diff -Nurd paramiko-2.12.0.orig/tests/test_client.py paramiko-2.12.0/tests/test_client.py
--- paramiko-2.12.0.orig/tests/test_client.py	2022-11-04 23:29:50.000000000 +0100
+++ paramiko-2.12.0/tests/test_client.py	2024-07-22 22:41:55.700718187 +0200
@@ -34,7 +34,6 @@
 from tempfile import mkstemp
 
 import pytest
-from pytest_relaxed import raises
 from mock import patch, Mock
 
 import paramiko
@@ -787,11 +786,11 @@
 
     # 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):
+            self._test_connection(passphrase="pygmalion")
 
     @requires_sha1_signing
     def test_passphrase_kwarg_used_for_key_passphrase(self):
@@ -811,15 +810,15 @@
             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",
+            )