Skip to content

Commit

Permalink
Merge branch 'master' into type-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Aug 26, 2020
2 parents 16d44f6 + 7c307ea commit f52d396
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
3.3.1 (2020-08-24)
3.3.1 (2020-08-26)
------------------

* Improved typing for ``MockerFixture.patch`` (`#201`_). Thanks `@srittau`_ for the PR.

.. _@srittau: https://github.com/srittau
.. _#201: https://github.com/pytest-dev/pytest-mock/pull/201

* Introduce ``MockFixture`` as an alias to ``MockerFixture``.

Before ``3.3.0``, the fixture class was named ``MockFixture``, but was renamed to ``MockerFixture`` to better
match the ``mocker`` fixture. While not officially part of the API, it was later discovered that this broke
the code of some users which already imported ``pytest_mock.MockFixture`` for type annotations, so we
decided to reintroduce the name as an alias.

Note however that this is just a stop gap measure, and new code should use ``MockerFixture`` for type annotations.

3.3.0 (2020-08-21)
------------------
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ the method, and uses pytest's own `advanced assertions`_ to return a better
diff::


mocker = <pytest_mock.MockFixture object at 0x0381E2D0>
mocker = <pytest_mock.MockerFixture object at 0x0381E2D0>

def test(mocker):
m = mocker.Mock()
Expand Down
3 changes: 3 additions & 0 deletions src/pytest_mock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from pytest_mock.plugin import *

MockFixture = MockerFixture # backward-compatibility only (#204)

__all__ = [
"MockerFixture",
"MockFixture",
"pytest_addoption",
"pytest_configure",
"session_mocker",
Expand Down

0 comments on commit f52d396

Please sign in to comment.