From b30cd6629f479d4e83ca4cac3daa81f53646301a Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 13 Mar 2024 11:27:33 -0400 Subject: [PATCH 1/4] export `MockType` --- src/pytest_mock/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pytest_mock/__init__.py b/src/pytest_mock/__init__.py index 127e5c8..908c434 100644 --- a/src/pytest_mock/__init__.py +++ b/src/pytest_mock/__init__.py @@ -7,12 +7,14 @@ from pytest_mock.plugin import pytest_addoption from pytest_mock.plugin import pytest_configure from pytest_mock.plugin import session_mocker +from pytest_mock.plugin import MockType MockFixture = MockerFixture # backward-compatibility only (#204) __all__ = [ "MockerFixture", "MockFixture", + "MockType", "PytestMockWarning", "pytest_addoption", "pytest_configure", From baea7d9c370f2ddbe73d75531d6f39e33eab8315 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:28:10 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pytest_mock/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_mock/__init__.py b/src/pytest_mock/__init__.py index 908c434..a663a48 100644 --- a/src/pytest_mock/__init__.py +++ b/src/pytest_mock/__init__.py @@ -1,4 +1,5 @@ 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 @@ -7,7 +8,6 @@ from pytest_mock.plugin import pytest_addoption from pytest_mock.plugin import pytest_configure from pytest_mock.plugin import session_mocker -from pytest_mock.plugin import MockType MockFixture = MockerFixture # backward-compatibility only (#204) From a9f3b2c1b6bffd1d8369129d64a02411cc9ed0a3 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 13 Mar 2024 11:39:42 -0400 Subject: [PATCH 3/4] add `AsyncMockType` --- src/pytest_mock/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pytest_mock/__init__.py b/src/pytest_mock/__init__.py index a663a48..75fd27a 100644 --- a/src/pytest_mock/__init__.py +++ b/src/pytest_mock/__init__.py @@ -1,3 +1,4 @@ +from pytest_mock.plugin import AsyncMockType from pytest_mock.plugin import MockerFixture from pytest_mock.plugin import MockType from pytest_mock.plugin import PytestMockWarning @@ -12,6 +13,7 @@ MockFixture = MockerFixture # backward-compatibility only (#204) __all__ = [ + "AsyncMockType", "MockerFixture", "MockFixture", "MockType", From 4dc1788aa49e06130ad5dade7289e140a6e8aa7d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 21 Mar 2024 16:34:23 -0300 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d977131..c16eed8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Releases ======== +UNRELEASED +---------- + +* `#415 `_: ``MockType`` and ``AsyncMockType`` can be imported from ``pytest_mock`` for type annotation purposes. + + 3.13.0 (2024-03-21) -------------------