mock安装(python2) mock安装命令:pip install mock 注:python2需要使用安装命令安装mock;python3不需要,mock已经被集成到了unittest单元测试框架中,所以,可以直接使用。