大批量运行case报错,不知道该如何解决

来源:4-6 如何大批量运行case文件

qq_醉朴_156

2020-08-22

图片描述

调试报错如下:
Testing started at 21:08 …
D:\python\python.exe “D:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pycharm_jb_unittest_runner.py” --path D:/work/python_workspace/TestPython/test/caseobject/RunTestCase.py
Launching unittests with arguments python -m unittest D:/work/python_workspace/TestPython/test/caseobject/RunTestCase.py in D:\work\python_workspace\TestPython\test\caseobject
<module ‘ntpath’ from ‘D:\python\lib\ntpath.py’>
D:\work\python_workspace\TestPython\test\caseobject\Case

Ran 1 test in 0.005s

FAILED (errors=1)

Error
Traceback (most recent call last):
File “D:\python\lib\unittest\case.py”, line 60, in testPartExecutor
yield
File “D:\python\lib\unittest\case.py”, line 676, in run
self._callTestMethod(testMethod)
File “D:\python\lib\unittest\case.py”, line 633, in _callTestMethod
method()
File “D:\work\python_workspace\TestPython\test\caseobject\RunTestCase.py”, line 11, in testCaseRun01
suite = unittest.defaultTestLoader.discover(path,“UnitTestCase*.py”)
File “D:\python\lib\unittest\loader.py”, line 346, in discover
raise ImportError(‘Start directory is not importable: %r’ % start_dir)
ImportError: Start directory is not importable: ‘D:\work\python_workspace\TestPython\test\caseobject\Case’

Process finished with exit code 1

请问老师,这个该如何解决呢?我代码是按照你说的这样弄的,但是为什么运行会报这样的错呢?

写回答

1回答

Mushishi

2020-08-22

建议百度:

ImportError: Start directory is not importable: ‘D:\work\python_workspace\TestPython\test\caseobject\Case’

 这个去解决。如果你没解决再提一下哈,我再告诉你 这个。这个就是一个简单得代码运行问题

0
2
Mushishi
回复
qq_醉朴_156
这哈知道了哈。
2020-08-23
共2条回复

Selenium3与Python3实战Web自动化测试框架

打破无项目经验、无框架经验瓶颈,实战Web自动化测试框架!

1883 学习 · 1093 问题

查看课程