◐ Shell
clean mode source ↗

Message 229207 - Python tracker

I'm -0.5 on this as well, and agree that we should try to keep the TestCase API small.

On one hand, a patch method available without extra imports would be handy, and having this as a generic function/method in unittest seems more natural to me than having it in unittest.mock.  On the other hand, adding it to unittest has downsides as well: it increases API complexity, adds duplication and possibly confusion (people might wonder if they should use TestCase.patch or unittest.mock.patch, and if there are any differences).  Adding both .patch and .patch_object makes things even worse.