Skip to content

Commit

Permalink
Add CHANGELOG and update README for 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Aug 22, 2020
1 parent 2344070 commit 28ea495
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
3.3.0 (2020-08-21)
------------------

* ``pytest-mock`` now includes inline type annotations and exposes them to user programs. The ``mocker`` fixture returns ``pytest_mock.MockerFixture``, which can be used to annotate your tests:

.. code-block:: python
from pytest_mock import MockerFixture
def test_foo(mocker: MockerFixture) -> None:
...
The type annotations were developed against mypy version ``0.782``, the
minimum version supported at the moment. If you run into an error that you believe to be incorrect, please open an issue.

Many thanks to `@staticdev`_ for providing the initial patch (`#199`_).

.. _@staticdev: https://github.com/staticdev
.. _#199: https://github.com/pytest-dev/pytest-mock/pull/199

3.2.0 (2020-07-11)
------------------

Expand Down
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ the appropriate mock fixture:
* ``package_mocker``
* ``session_mocker``

Type Annotations
----------------

*New in version 3.3.0.*

``pytest-mock`` is fully type annotated, letting users use static type checkers to
test their code.

The ``mocker`` fixture returns ``pytest_mock.MockerFixture`` which can be used
to annotate test functions:

.. code-block:: python
from pytest_mock import MockerFixture
def test_foo(mocker: MockerFixture) -> None:
...
The type annotations have been checked with ``mypy``, which is the only
type checker supported at the moment; other type-checkers might work
but are not currently tested.

Spy
---

Expand Down

0 comments on commit 28ea495

Please sign in to comment.