Skip to content

Commit

Permalink
Merge pull request #89 from cjwatson/drop-mock
Browse files Browse the repository at this point in the history
Drop support for external mock package
  • Loading branch information
cjwatson authored Dec 24, 2024
2 parents 392d98a + 06c3728 commit b12928b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ existing handlers are removed and replaced by the provided handler, while if
``MockPatchObject``
+++++++++++++++++++

Adapts ``mock.patch.object`` to be used as a fixture:
Adapts ``unittest.mock.patch.object`` to be used as a fixture:

.. code-block:: python
Expand All @@ -419,7 +419,7 @@ Adapts ``mock.patch.object`` to be used as a fixture:
``MockPatch``
+++++++++++++

Adapts ``mock.patch`` to be used as a fixture:
Adapts ``unittest.mock.patch`` to be used as a fixture:

.. code-block:: python
Expand All @@ -428,7 +428,7 @@ Adapts ``mock.patch`` to be used as a fixture:
``MockPatchMultiple``
+++++++++++++++++++++

Adapts ``mock.patch.multiple`` to be used as a ``fixture``:
Adapts ``unittest.mock.patch.multiple`` to be used as a ``fixture``:

.. code-block:: python
Expand Down
8 changes: 2 additions & 6 deletions fixtures/_fixtures/mockpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.

import fixtures
import unittest.mock as mock

# TODO(stephenfin): Make this configurable
try:
import mock
except ImportError:
import unittest.mock as mock
import fixtures


class _Base(fixtures.Fixture):
Expand Down
2 changes: 1 addition & 1 deletion fixtures/tests/_fixtures/test_mockpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# under the License.


import mock # Yes, we only test the rolling backport
import testtools
from unittest import mock

from fixtures import (
MockPatch,
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ packages =
streams =
testtools
test =
mock
testtools
docs =
docutils

0 comments on commit b12928b

Please sign in to comment.