Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export MockType for type annotations #415

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Releases
========

UNRELEASED
----------

* `#415 <https://github.com/pytest-dev/pytest-mock/pull/415>`_: ``MockType`` and ``AsyncMockType`` can be imported from ``pytest_mock`` for type annotation purposes.


3.13.0 (2024-03-21)
-------------------

Expand Down
4 changes: 4 additions & 0 deletions src/pytest_mock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from pytest_mock.plugin import AsyncMockType
from pytest_mock.plugin import MockerFixture
from pytest_mock.plugin import MockType
from pytest_mock.plugin import PytestMockWarning
from pytest_mock.plugin import class_mocker
from pytest_mock.plugin import mocker
Expand All @@ -11,8 +13,10 @@
MockFixture = MockerFixture # backward-compatibility only (#204)

__all__ = [
"AsyncMockType",
"MockerFixture",
"MockFixture",
"MockType",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also AsyncMockType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

I'm not a maintainer to pytest-mock but it just so happened that I thought to check github issues for this & you had made an awesome change that solved issue.

Thank you!

"PytestMockWarning",
"pytest_addoption",
"pytest_configure",
Expand Down
Loading