我正在尝试从 __init__.py
文件导入单元测试。因此我得到了错误
ImportError: cannot import name 'Testcase' from 'unittest'
如果我错了,请澄清我。
最佳答案
使用:
from unittest import TestCase
或
unittest.TestCase
例子:
import unittest
class TestFoo(unittest.TestCase):
def a:
return ()
问题在于大小写敏感度
关于python - 导入错误 : cannot import name 'Testcase' from 'unittest' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51531910/