欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

现在是 2024 年,还在学习 pytest - 夹具问题整理 - 跟随博主提问:是在电脑本地终端安装,还是在 pythoncharm 终端安装?------ 就在 pythoncharm 终端安装吧 ** 注:在公司安装不行,换豆豆源也不行,连接手机热点试试,可能是公司网络阻塞。 venvenv变红了且安装不上pytest 然后你会发现 改一下选择现有,就解决了,还有路径中最好不要有中文7.16-学习demo的过程发现:为何一定需要@pytest.fixture才能正常传递参数

最编程 2024-07-18 07:13:51
...
@pytest.fixture
def login():
    print("请输入账号密码:")

def test_s1(login):
    print("用例1 登录后操作1 tests1")

def test_s2():
    print("用例2 不需要登录2 test_s2")