class TestCaseEditFlag(HttpRunner): config = Config("testcase description") teststeps = [ Step( RunRequest("/cgi-bin/token") .get("https://api.weixin.qq.com/cgi-bin/token") .with_params( **{ "appid": "wx74a8627810cfa308", "grant_type": "client_credential", "secret": "e40a02f9d79a8097df497e6aaf93ab80", } ) 如何修改为禁用代理
时间: 2024-02-14 15:24:20 浏览: 153
HttpRunner框架笔记(全网最全!!!附视频讲解!!!免费!!!)
你可以在 `Step` 中使用 `with_config` 方法来禁用代理。具体的修改方法如下:
```
class TestCaseEditFlag(HttpRunner):
config = Config("testcase description")
teststeps = [
Step(
RunRequest("/cgi-bin/token")
.get("https://api.weixin.qq.com/cgi-bin/token")
.with_params(
**{
"appid": "wx74a8627810cfa308",
"grant_type": "client_credential",
"secret": "e40a02f9d79a8097df497e6aaf93ab80",
}
)
.with_config(
proxies=None # 禁用代理
)
)
]
```
这样就可以将代理禁用了。
阅读全文