
Python
文章平均质量分 84
Eason_fyc
人生无编程
展开
-
Python中的多进程
multiprocessing模块multiprocessing模块提供了一个Process类来代表一个进程对象,下面的例子演示了启动一个子进程并等待其结束:from multiprocessing import Process import os # 子进程要执行的代码 def run_proc(name): print('Run child process %s (%s), ...转载 2018-03-30 15:42:51 · 470 阅读 · 0 评论 -
Python3 使用Turq mock一个极轻量的http server
前提在写一个自动化测试suite的过程中,需要测试一个异步的API。调用这个API会向一个notification server发送一个包含notification的request,notification server根据reques的内容返回一个response,response包含了此次调用的最终结果。因此,测试这个API需要一个notification server,怎么办?mock一个简...原创 2018-04-09 17:39:15 · 1988 阅读 · 3 评论