-
pytest-mock
now includes inline type annotations and exposes them to user programs. Themocker
fixture returnspytest_mock.MockerFixture
, which can be used to annotate your tests: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.