Closed mgorny closed 3 years ago
Yes, but Python 2.7 does not. I'll keep this open as a reminder for when I drop Python 2.7 support.
Many packages make the dependency conditional to Python version. This lets distributions who don't need Python 2 for this package anymore get rid of mock for Python 3 as well.
Yes, Py3 contains mock
, however, I have found it to be useful to continue to depend on mock
even in my Py3 code because the code changes from:
import mock
to
from unittest import mock
I'm glad they integrated the base functionality of mocking; but the interface change is important too. Further, packages like six
don't map that move either since mock
wasn't part of Py2. There's also no real difference between installing mock
and continuing to use unittest.mock
- they're both feature equivalent.
IIRC, mock is maintained similarly to argparse; there's still an argparse package out there and you can choose to depend on it too if you like, but with Py2 it wasn't required. That at least was a little cleaner integration/change than mock has been.
$0.02 FWIW
Python 2 support was dropped in #92, so this can be closed.
Right, thanks for the headsup, this is indeed done now, thanks to Alex.
Python 3 provides mocking support in
unittest.mock
. Depending on externalmock
package shouldn't be necessary there.