Ich versuche, ein Attribut Unittest auf ein Objekt in PythonAttribut Fehler in Python
class Boy:
def run(self, args):
print("Hello")
class BoyTest(unittest.TestCase)
def test(self)
self.assertEqual('2' , '2')
def self_test():
suite = unittest.TestSuite()
loader = unittest.TestLoader()
suite.addTest(loader.loadTestsFromTestCase(Boy.BoyTest))
return suite
jedoch hinzufügen, ich bekomme immer wieder "AttributeError: class Boy has no attribute 'BoyTest'"
wenn ich self_test()
nennen. Warum?