Skip to content

Commit 03da957

Browse files
authored
Merge pull request #200 from nicoddemus/release-3.3.0
Add CHANGELOG and update README for 3.3.0
2 parents 2344070 + 28ea495 commit 03da957

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

CHANGELOG.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
3.3.0 (2020-08-21)
2+
------------------
3+
4+
* ``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:
5+
6+
.. code-block:: python
7+
8+
from pytest_mock import MockerFixture
9+
10+
def test_foo(mocker: MockerFixture) -> None:
11+
...
12+
13+
The type annotations were developed against mypy version ``0.782``, the
14+
minimum version supported at the moment. If you run into an error that you believe to be incorrect, please open an issue.
15+
16+
Many thanks to `@staticdev`_ for providing the initial patch (`#199`_).
17+
18+
.. _@staticdev: https://github.com/staticdev
19+
.. _#199: https://github.com/pytest-dev/pytest-mock/pull/199
20+
121
3.2.0 (2020-07-11)
222
------------------
323

README.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,28 @@ the appropriate mock fixture:
9090
* ``package_mocker``
9191
* ``session_mocker``
9292

93+
Type Annotations
94+
----------------
95+
96+
*New in version 3.3.0.*
97+
98+
``pytest-mock`` is fully type annotated, letting users use static type checkers to
99+
test their code.
100+
101+
The ``mocker`` fixture returns ``pytest_mock.MockerFixture`` which can be used
102+
to annotate test functions:
103+
104+
.. code-block:: python
105+
106+
from pytest_mock import MockerFixture
107+
108+
def test_foo(mocker: MockerFixture) -> None:
109+
...
110+
111+
The type annotations have been checked with ``mypy``, which is the only
112+
type checker supported at the moment; other type-checkers might work
113+
but are not currently tested.
114+
93115
Spy
94116
---
95117

0 commit comments

Comments
 (0)