PyCharm会自动检测文件的开头test_
,并尝试将它们作为Unittests运行.这是非常体贴的,但似乎有些东西被破坏了,而且在我运行的任何测试中,我得到了
/Users/peter/projects/plato/venv/bin/python2.7 "/Applications/PyCharm CE.app/Contents/helpers/pycharm/utrunner.py" /Users/peter/projects/plato/utils/tools/test_sampling.py::::test_samplers_not_broken true
Testing started at 10:58 AM ...
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pycharm/utrunner.py", line 140, in <module>
all.addTest(testLoader.makeTest(getattr(module, a[2])))
AttributeError: 'TestLoader' object has no attribute 'makeTest'
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
我想做的就是将它们作为普通的python文件运行,但是PyCharm不会让我这么做.Eclipse提供了正常运行或作为unittest运行的选项.这很烦人!我怎样才能做到这一点?
虽然看起来您无法全局禁用此选项,但您可以阻止单个文件作为测试运行.请参阅此问题以获得答案.
归档时间: |
|
查看次数: |
7740 次 |
最近记录: |