Closed Capstan closed 7 years ago
My follow-up question is, how might one check that these calls exist, and maybe even are the first call (modulo decorator wrappers)?
@Capstan if you ware willing to implement it, there is a super-init-not-called
check, which may be modified for checking for setUp and tearDown inheritance on unittest.TestCase instance.
I think this is a bit too specific and I would see it more as an extension, rather than a default check.
I recently introduced a bug where by creating a child test case with a
setUp()
method without an initial call tosuper(MyTest, self).setUp()
, some necessary calls were omitted. It seems like the following calls in descendants ofunittest.TestCase
not calling their parents' versions would be worthy of a lint error: