As you seem to support python 2, I guess you cannot get rid of mock entirely, but perhaps you could optionally use unittest.mock as a fallback.