如何使用Monkey补丁编写属性服务调用的pytest?
我有一个函数来调用属性服务调用。现在,我想使用猴子补丁为此写pytest。如何为此猴子补丁编写测试代码?
def attr_service_call(attr_url):
PARAMS = {'username':'username', 'password':'password'}
resp = requests.get(attr_url, params=PARAMS, timeout= 30)
resp_json = resp.json()
resturn resp_json
如何使用Monkey Patching为上述代码和ATTR服务调用编写pytest。帮我为此写pytest。谢谢
I have one function for calling attribute service call. Now I want to write pytest for that using monkey patch. How to write test code for this monkey patch was called?
def attr_service_call(attr_url):
PARAMS = {'username':'username', 'password':'password'}
resp = requests.get(attr_url, params=PARAMS, timeout= 30)
resp_json = resp.json()
resturn resp_json
How to write pytest for above code and and attr service call was called using monkey patching. Help me to write pytest for this. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论