I'm trying to import the unit test from a __init__.py
file. Hence I'm getting the error
ImportError: cannot import name 'Testcase' from 'unittest'
Clarify me if I'm wrong.
use :
from unittest import TestCase
or
unittest.TestCase
example:
import unittest
class TestFoo(unittest.TestCase):
def a:
return ()
issue was with the case sentivity
我认为只要这样做=>导入unittest
就可以解决所有问题
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.