title: how can i test an abstract method in python 2.6
body: <p>I have an abstract class:</p>
  
  <pre><code>import abc
  
  
  class Hello(object):
      __metaclass__ = abc.ABCMeta
  
      @abc.abstractmethod
      def add(self, foo):
          pass
  
      @abc.abstractmethod
      def remove(self, foo):
          pass
  </code></pre>
  
  <p>I'm using abc for do abstract methods, so, when i do:</p>
  
  <pre><code>hello = Hello()
  </code></pre>
  
  <p>and this error is raised: <code>TypeError: Can't instantiate abstract class Hello with abstract methods add, remove</code></p>
  
  <p>So I can test this type error with:</p>
  
  <pre><code>self.assertRaises(Exception, Hello)  # but this only test the constructor and i can't get the 100% of code coverage. I need call the add method and the remove method
  </code></pre>
  
  <p>Extra question: anybody knows how can i assert the message exception in python 2.6? (you can't use the <code>with:</code> for raise assertions.)</p>
  
  <p>How can i test this abstract methods for get the 100% of code coverage? </p>