1 Star 0 Fork 30

albatross/python-paramiko

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
paramiko-2.7.2-drop-pytest-relaxed.patch 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
zhaorenhai 提交于 2021-01-30 19:44 +08:00 . upgrade version to 2.7.2
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(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index 60ad310c..2d665cdd 100644
--- 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
from mock import patch, Mock
import paramiko
@@ -684,10 +684,10 @@ class PasswordPassphraseTests(ClientTest):
# 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.
- self._test_connection(passphrase="pygmalion")
+ 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.
@@ -705,14 +705,14 @@ class PasswordPassphraseTests(ClientTest):
password="television",
)
- @raises(AuthenticationException) # TODO: more granular
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 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',
+ )
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jade_t/python-paramiko.git
git@gitee.com:jade_t/python-paramiko.git
jade_t
python-paramiko
python-paramiko
master

搜索帮助