Let's say I have this parent class:
class BaseTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
# I want to assign the name of the class that called
# the super class in a variable.
cls.child_class_name = ??
# Do some more stuff...
And I have this class that inherits from the BaseTestCase class above:
class MyTestCase(BaseTestCase):
@classmethod
def setUpClass(cls):
# Call SetUpClass from parent (BaseTestCase)
super(cls, cls).setUpClass()
# Do more stuff...
Since many classes can inherit from the same parent class. How can I know the name of the class that invoked the parent class in a given time?
I hope my question make sense. :S