I have a parent class that, within its __init__ calls some internal class methods:
class Parent:
def __init__(self):
...
my_method()
def my_method(self, a...):
pass
Afterwards, I create a child class that relies on that Parent class. After creating instance objects of the Child class, they explicitly invoque the parent's __init__ method
class Child(Parent):
def __init__(self, a):
super().__init__(a)
I would like to mock the parent class such that I can test its child without fully relying on the parent's initialization function, which calls my_method. This my_method is problematic and causes the test of the Child to fail due to its parent necessarily calling that method.
Answers with pytest would be appreciated