我是第一次尝试参考这篇文章的 python 单元测试。我的 Eclipse 中安装了 PyDev 插件。
我的test_hello.py
样子是这样的:
import unittest
class TestHello(unittest.TestCase):
def test_abc(self):
print("Test!!!")
result = True
self.assertEqual(result, True, "ohno")
当 I 时Right click on source > Run As > Python unit-test
,它输出:
Finding files... done.
Importing test modules ... PYTHONPATH not found for file: D:\workspaces\python-ws\test\test_h
done.
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
同样在 PyUnit 选项卡中,它不显示任何内容:
我在这里缺少什么?
更新
添加更多细节:
我的项目:
PyDev 包资源管理器