You need to patch where ClassC is located so that’s ClassC in b:
mock.patch('b.ClassC')
Or, in other words, ClassC is imported into module b and so that’s the scope in which ClassC needs to be patched.
You need to patch where ClassC is located so that’s ClassC in b:
mock.patch('b.ClassC')
Or, in other words, ClassC is imported into module b and so that’s the scope in which ClassC needs to be patched.