python pytest requests

没有找到与「python pytest requests」相关的内容

AI 回答 由 glm-4-flash 生成 · 仅供参考,请自行核实
1. 安装pytest和requests库

pip install pytest requests

2. 编写测试用例

import pytest
import requests

def test_get_response():
response = requests.get('http://example.com')
assert response.status_code == 200

3. 运行测试

pytest

相关搜索