python-paramiko/paramiko-2.7.2-drop-pytest-relaxed.patch

63 lines
2.3 KiB
Diff
Raw Normal View History

2021-01-30 11:44:42 +00:00
From 953d9a1f1055de97e35c7060fcebc7283eff9e29 Mon Sep 17 00:00:00 2001
From: zhaorenhai <zhaorenhai@hotmail.com>
Date: Fri, 29 Jan 2021 06:48:10 +0000
Subject: [PATCH] drop pytest-relaxed
---
tests/test_client.py | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
2020-02-14 19:34:08 +08:00
diff --git a/tests/test_client.py b/tests/test_client.py
2021-01-30 11:44:42 +00:00
index 60ad310c..2d665cdd 100644
2020-02-14 19:34:08 +08:00
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -33,7 +33,7 @@ import warnings
import weakref
from tempfile import mkstemp
-from pytest_relaxed import raises
+from pytest import raises
2021-01-30 11:44:42 +00:00
from mock import patch, Mock
2020-02-14 19:34:08 +08:00
import paramiko
2021-01-30 11:44:42 +00:00
@@ -684,10 +684,10 @@ class PasswordPassphraseTests(ClientTest):
2020-02-14 19:34:08 +08:00
# TODO: more granular exception pending #387; should be signaling "no auth
# methods available" because no key and no password
- @raises(SSHException)
def test_passphrase_kwarg_not_used_for_password_auth(self):
- # Using the "right" password in the "wrong" field shouldn't work.
2021-01-30 11:44:42 +00:00
- self._test_connection(passphrase="pygmalion")
2020-02-14 19:34:08 +08:00
+ with raises(SSHException):
+ # Using the "right" password in the "wrong" field shouldn't work.
+ self._test_connection(passphrase='pygmalion')
def test_passphrase_kwarg_used_for_key_passphrase(self):
# Straightforward again, with new passphrase kwarg.
2021-01-30 11:44:42 +00:00
@@ -705,14 +705,14 @@ class PasswordPassphraseTests(ClientTest):
password="television",
2020-02-14 19:34:08 +08:00
)
2021-01-30 11:44:42 +00:00
- @raises(AuthenticationException) # TODO: more granular
def test_password_kwarg_not_used_for_passphrase_when_passphrase_kwarg_given( # noqa
self
):
2020-02-14 19:34:08 +08:00
- # Sanity: if we're given both fields, the password field is NOT used as
- # a passphrase.
- self._test_connection(
2021-01-30 11:44:42 +00:00
- key_filename=_support("test_rsa_password.key"),
- password="television",
- passphrase="wat? lol no",
2020-02-14 19:34:08 +08:00
- )
+ with raises(AuthenticationException): # TODO: more granular
+ # 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',
+ )
2021-01-30 11:44:42 +00:00
--
2.27.0
2020-02-14 19:34:08 +08:00