Python 测试一个接口的多个实现
假设我有一个定义如下的接口:Python 测试一个接口的多个实现,python,unit-testing,Python,Unit Testing,假设我有一个定义如下的接口: class MyInterface(abc.ABCMeta): @abstractmethod def my_method(self, *params): pass 以及它的几个实现 class Implentation1(MyInterface): pass class Implentation2(MyInterface): pass 所有这些类都必须在同一类下进行测试。我想知道是否有任何方法可以指定您
class MyInterface(abc.ABCMeta):
@abstractmethod
def my_method(self, *params):
pass
以及它的几个实现
class Implentation1(MyInterface):
pass
class Implentation2(MyInterface):
pass
所有这些类都必须在同一类下进行测试。我想知道是否有任何方法可以指定您希望使用不同的类运行测试用例。我使用的是nosetest和unittest。您可以
参数化测试,并向它们提供实现列表。