Unittest下设置用unittest方式运行(也可设置用Python运行代码):_xing2516_新浪博客

1. 点击右上角Edit config...

Unittest下设置用unittest方式运行(也可设置用Python运行代码):_xing2516_新浪博客

2.点击+Python tests---unittests;最后选择要用unittest运行的代码文件

Unittest下设置用unittest方式运行(也可设置用Python运行代码):_xing2516_新浪博客

Unittest可设置用Python运行代码

同样 设置后,需要加上2句代码,才能用Python运行

可参考代码文件 http://blog.sina.com.cn/s/blog_48dae5760102yfv9.html