I have a bunch of methods that need to be tested. I'd like to implement a check to ensure that I've written a test for each method. I'm able to check this in my tearDownClass() if I keep a list of tests run, but I can't figure out a way to fail from there.
if I try to do this:
class TestSystem(unittest.TestCase):
class TestAB(TestSystem):
@classmethod
def setUpClass(self):
print "ABSetup"
@classmethod
def tearDownClass(self):
if (testsNotImplemented()):
self.fail() #I'd like to fail TestAB here
print "ABTeardown"
I get a TypeError: unbound method fail() must be called with TestAB instance as first argument (got type instance instead)
What's the proper way to do this? Even just printing a message would be ok (if not ideal), but as far as I can tell, wing doesn't output "print" messages from withing the setup and teardown methods.
This question is similar, but I don't want the tests to crash, just fail.