This is an automated email from the ASF dual-hosted git repository.
taragolis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 0574ea1b1e Add type annotations for other `pytest-mock` fixtures
(#38245)
0574ea1b1e is described below
commit 0574ea1b1e7b0ed8adcf54811a59d80607d36b99
Author: Andrey Anshin <[email protected]>
AuthorDate: Wed Mar 20 20:37:28 2024 +0400
Add type annotations for other `pytest-mock` fixtures (#38245)
* Add type annotations for other `pytest-mock` fixtures
* class -> module, Package-> Session
---
tests/conftest.py | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index bb6b37ea40..adba65c774 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1355,7 +1355,24 @@ if TYPE_CHECKING:
# pytest-mock
@pytest.fixture
- def mocker() -> MockerFixture: ...
+ def mocker() -> MockerFixture:
+ """Function scoped mocker."""
+
+ @pytest.fixture(scope="class")
+ def class_mocker() -> MockerFixture:
+ """Class scoped mocker."""
+
+ @pytest.fixture(scope="module")
+ def module_mocker() -> MockerFixture:
+ """Module scoped mocker."""
+
+ @pytest.fixture(scope="package")
+ def package_mocker() -> MockerFixture:
+ """Package scoped mocker."""
+
+ @pytest.fixture(scope="session")
+ def session_mocker() -> MockerFixture:
+ """Session scoped mocker."""
# requests-mock
@pytest.fixture