Fixed #23289 -- Added mock as a test dependency.

Yea, my argument was a bit hand-wavy. I would like to strip out all the Python 2 compatibility utilities when we drop Python 2 support instead of putting them all through the deprecation process (after all, if we no longer have Python 2 support, we won't be able to test any of them on Python 2). I guess we'll decide what to do when the time comes though.