Testing abstract classes in Python
Consider the following scenario.
from abc import ABCMeta, abstractmethod
class ThisIsAnAbstractClass(ABCMeta):
@abstractmethod
def __init__(self,parameter):
self.parameter = parameter
def do_something():
"""do something"""
There is a class extended form ABCMeta (an abstract class) with an
abstract method in it. This class cannot be initialized because of that
abstract init() method. Is there a way to test this class? (at least using
any testing framework)
No comments:
Post a Comment