wolever / parameterized

Parameterized testing with any Python test framework
Other
833 stars 105 forks source link

parameterized_class does not work with inheritence #173

Open tjbrix opened 1 year ago

tjbrix commented 1 year ago
@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.

wangkun611 commented 1 year ago

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.

eltoder commented 3 weeks ago

What would you expect to happen? What value should self.X be in SubClass?