如题,在pycharm中执行主程序运行成功: 已连接主机
登录成功
正在发送......
邮件发送完成~ Process finished with exit code 0 在cmd执行主程序报错:- Traceback (most recent call last):
- File"all_test.py",line 32,in
- alltestnames = creatsuite()
- File"all_test.py",line 27,in creatsuite
- testunit.addTests(test_case)
- File "C:\Python37\lib\unittest\suite.py",line57,in addTests
- for test in tests:
- TypeError:'_FailedTest'object is not iterable
复制代码 报错的程序代码是这部分:def creatsuite(): - testunit = unittest.TestSuite()
- test_dir = test_suite_dir
- package_tests = unittest.defaultTestLoader.discover(test_dir,
- pattern='*.py',
- top_level_dir=None)
- for test_suite in package_tests:
- for test_case in test_suite:
- testunit.addTests(test_case)
- print(testunit)
- return testunit
复制代码刚接触接口测试,请问是哪里出了问题呢?因为正在jenkins构建项目执行,把源码放在github后使用windows批处理命令执行,这样进程是停滞的,也结束不了。
|