I think a better approach would be to change that unit test to use patch in a setUp
function and then it will apply for all tests in that module, but will be reverted in the end, this is also better as each test will have it's own and not one single mock for all of them (If for instance, you test the number of time a method is called in the module you will have to accumulate all calls in the test...)
Another option is to use the tearDown
function and change a bit the way you assign the mock to:
import moduleABC
orig_abc = sys.modules['moduleABC']
sys.modules['moduleABC'] = mock.MagicMock()
def tearDown():
sys.modules['moduleABC'] = orig_abc
But I strongly recommend the first option, as it is the better approach.