-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathconftest.py
More file actions
31 lines (23 loc) · 754 Bytes
/
conftest.py
File metadata and controls
31 lines (23 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Common pytest fixtures.
Copyright 2025 Vlad Emelianov
"""
from unittest.mock import MagicMock
import pytest
from pytest_mock import MockerFixture
BOTOCORE_SESSION = MagicMock()
@pytest.fixture(autouse=True)
def botocore_session_mock(mocker: MockerFixture) -> MagicMock:
"""
Mock boto3 session to avoid real AWS calls."""
mocker.patch("mypy_boto3_builder.utils.boto3_utils.get_session", return_value=BOTOCORE_SESSION)
return BOTOCORE_SESSION
@pytest.fixture(autouse=True)
def import_version_mock(mocker: MockerFixture) -> MagicMock:
"""
Mock _import_version to always return 1.2.3.
"""
return mocker.patch(
"mypy_boto3_builder.utils.version_getters._import_version",
return_value="1.2.3",
)