how can i test an abstract method in python 2.6
问题 I have an abstract class: import abc class Hello(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def add(self, foo): pass @abc.abstractmethod def remove(self, foo): pass I'm using abc for do abstract methods, so, when i do: hello = Hello() and this error is raised: TypeError: Can't instantiate abstract class Hello with abstract methods add, remove So I can test this type error with: self.assertRaises(Exception, Hello) # but this only test the constructor and i can't get the 100% of