parameterized
parameterized copied to clipboard
parameterized_class does not work with inheritence
@parameterized_class("X", [1,2])
class BaseClass(unittest.TestCase):
#code
class SubClass(BaseClass):
def test_func(self):
print(self.X)
=> Class SubClass has no Attribute X
Ich verwende nose2.
parameterized_class generates lots of new classes based on parameters and remove all test methods of BaseClass. The name of new classes may be BaseClass_0X1,BaseClass_1X2 or whatever.
You should not write a new class inherited from BaseClass.
What would you expect to happen? What value should self.X be in SubClass?