Here the ABC() and obj.print_1() get called during the import time and it prints "making object" and "printed 1" respectively. How can we mock all the three functions, __init__(), print_1(), and print_2()? xyz.py from abc import ABC obj = ABC() obj.print_1() def func(): return obj.print_2(2) abc.py class ABC(): def __init__(self): print("making object") def print_1(self): print("printed 1") return None def print_2(self, val): print("printed ", val) return None Continue reading...