![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytest
pytest
weixin_39851178
这个作者很懒,什么都没留下…
展开
-
论pytest封装Ubuntu命令一
1:最刚开始的原始脚本如下 import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # 跳过了远程连接中选择‘是’的环节, ssh.connect(hostname='192.168.0.128', port=22, username='x', password='1') stdin, stdout, stderr = ssh.exec_command('ls原创 2021-03-03 11:05:37 · 212 阅读 · 0 评论 -
pytest之传递参数的方法
import pytest @pytest.fixture(autouse=True,params=[‘user1’,‘user2’,‘user3’]) def login(): print(“登录方法”) yield [‘username’,‘password’] print(“teardown”) @pytest.mark.parametrize(‘login’, [(1,2),(3,4)]) def test_car(login): print(“你好”) print(f"{login}") 返回结原创 2020-11-11 22:07:33 · 1193 阅读 · 0 评论