Interface tests: tell what class is wrong.

Instead of just failing with no clue except that 0 is equal to 0...
parent f9126f6a
......@@ -53,7 +53,8 @@ def getImplementationAssertionMethod(klass, interface):
def getDeclarationAssertionMethod(klass):
"""Returns method which verifies if klass is declaring interface"""
def testMethod(self):
self.assertNotEqual(0, len(list(zope.interface.implementedBy(klass))))
if len(list(zope.interface.implementedBy(klass))) == 0:
self.fail('%s class does not respect its interface(s).' % klass.__name__)
return testMethod
def generateTestMethodListOnClass(klass, module):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment