怎么会提示给类的实例 __init__ 传递了 2 个参数?why 啊?
import unittest
class Test(unittest.TestCase):
def __init__(self):
self.a = 1
def test1(self):
self.assertEqual(self.a, 1)
if __name__ == '__main__':
unittest.main()
output:
....省略没用的
TypeError: __init__() takes 1 positional argument but 2 were given
[Finished in 0.2s with exit code 1]