parameterized icon indicating copy to clipboard operation
parameterized copied to clipboard

parameterized_class does not work with inheritence

Open tjbrix opened this issue 2 years ago • 2 comments

@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.

tjbrix avatar Jun 07 '23 13:06 tjbrix

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.

wangkun611 avatar Aug 31 '23 10:08 wangkun611

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

eltoder avatar Aug 15 '24 17:08 eltoder