Skip to content

Commit ab4b92f

Browse files
committed
Added type hints into tests/unit/utils/test_llama_stack_version.py
1 parent 7518bc7 commit ab4b92f

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

tests/unit/utils/test_llama_stack_version.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""Unit tests for utility function to check Llama Stack version."""
22

3+
from typing import Any
4+
35
import pytest
6+
47
from semver import Version
58
from pytest_mock import MockerFixture
9+
from pytest_subtests import SubTests
610

711
from llama_stack_client.types import VersionInfo
812

@@ -20,7 +24,7 @@
2024
@pytest.mark.asyncio
2125
async def test_check_llama_stack_version_minimal_supported_version(
2226
mocker: MockerFixture,
23-
):
27+
) -> None:
2428
"""Test the check_llama_stack_version function."""
2529

2630
# mock the Llama Stack client
@@ -36,7 +40,7 @@ async def test_check_llama_stack_version_minimal_supported_version(
3640
@pytest.mark.asyncio
3741
async def test_check_llama_stack_version_maximal_supported_version(
3842
mocker: MockerFixture,
39-
):
43+
) -> None:
4044
"""Test the check_llama_stack_version function."""
4145

4246
# mock the Llama Stack client
@@ -50,7 +54,9 @@ async def test_check_llama_stack_version_maximal_supported_version(
5054

5155

5256
@pytest.mark.asyncio
53-
async def test_check_llama_stack_version_too_small_version(mocker: MockerFixture):
57+
async def test_check_llama_stack_version_too_small_version(
58+
mocker: MockerFixture,
59+
) -> None:
5460
"""Test the check_llama_stack_version function."""
5561

5662
# mock the Llama Stack client
@@ -68,7 +74,7 @@ async def test_check_llama_stack_version_too_small_version(mocker: MockerFixture
6874
await check_llama_stack_version(mock_client)
6975

7076

71-
async def _check_version_must_fail(mock_client, bigger_version):
77+
async def _check_version_must_fail(mock_client: Any, bigger_version: Version) -> None:
7278
mock_client.inspect.version.return_value = VersionInfo(version=str(bigger_version))
7379

7480
expected_exception_msg = (
@@ -81,7 +87,9 @@ async def _check_version_must_fail(mock_client, bigger_version):
8187

8288

8389
@pytest.mark.asyncio
84-
async def test_check_llama_stack_version_too_big_version(mocker, subtests):
90+
async def test_check_llama_stack_version_too_big_version(
91+
mocker: MockerFixture, subtests: SubTests
92+
) -> None:
8593
"""Test the check_llama_stack_version function."""
8694

8795
# mock the Llama Stack client

0 commit comments

Comments
 (0)