Instead of instantiating the object in every method, you can use the extraglobs
argument:
class Test:
def multiply_by_2(self):
"""
>>> t.multiply_by_2()
10
"""
return self._number*2
if __name__ == '__main__':
import doctest
doctest.testmod(extraglobs={'t': Test()})