-
Notifications
You must be signed in to change notification settings - Fork 58
LCORE-739: added return type to unit tests #669
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
LCORE-739: added return type to unit tests #669
Conversation
WalkthroughExplicit return type annotations (-> None) were added to test functions in tests/unit/metrics/test_utis.py and tests/unit/utils/test_common.py. No logic, control flow, or dependencies were changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/unit/metrics/test_utis.py (1)
6-6: LGTM! Return type annotations improve type safety.The explicit
-> Nonereturn type annotations align with the coding guidelines requirement for complete type annotations.For complete type coverage, consider adding type hints to the
mockerparameter:+from pytest_mock import MockerFixture + -async def test_setup_model_metrics(mocker) -> None: +async def test_setup_model_metrics(mocker: MockerFixture) -> None: -def test_update_llm_token_count_from_turn(mocker) -> None: +def test_update_llm_token_count_from_turn(mocker: MockerFixture) -> None:As per coding guidelines
Also applies to: 79-79
tests/unit/utils/test_common.py (1)
21-21: LGTM! Return type annotations improve type safety.The explicit
-> Nonereturn type annotations on all async test functions align with the coding guidelines requirement for complete type annotations.For complete type coverage, consider adding type hints to the
mockerparameter across all test functions:+from pytest_mock import MockerFixture + -async def test_register_mcp_servers_empty_list(mocker) -> None: +async def test_register_mcp_servers_empty_list(mocker: MockerFixture) -> None: -async def test_register_mcp_servers_single_server_not_registered(mocker) -> None: +async def test_register_mcp_servers_single_server_not_registered(mocker: MockerFixture) -> None: -async def test_register_mcp_servers_single_server_already_registered(mocker) -> None: +async def test_register_mcp_servers_single_server_already_registered(mocker: MockerFixture) -> None: -async def test_register_mcp_servers_multiple_servers_mixed_registration(mocker) -> None: +async def test_register_mcp_servers_multiple_servers_mixed_registration(mocker: MockerFixture) -> None: -async def test_register_mcp_servers_with_custom_provider(mocker) -> None: +async def test_register_mcp_servers_with_custom_provider(mocker: MockerFixture) -> None: -async def test_register_mcp_servers_async_with_library_client(mocker) -> None: +async def test_register_mcp_servers_async_with_library_client(mocker: MockerFixture) -> None:As per coding guidelines
Also applies to: 52-52, 97-97, 135-135, 197-197, 238-238
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/unit/metrics/test_utis.py(2 hunks)tests/unit/utils/test_common.py(6 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: All modules start with descriptive module-level docstrings explaining purpose
Use logger = logging.getLogger(name) for module logging after import logging
Define type aliases at module level for clarity
All functions require docstrings with brief descriptions
Provide complete type annotations for all function parameters and return types
Use typing_extensions.Self in model validators where appropriate
Use modern union syntax (str | int) and Optional[T] or T | None consistently
Function names use snake_case with descriptive, action-oriented prefixes (get_, validate_, check_)
Avoid in-place parameter modification; return new data structures instead of mutating arguments
Use appropriate logging levels: debug, info, warning, error with clear messages
All classes require descriptive docstrings explaining purpose
Class names use PascalCase with conventional suffixes (Configuration, Error/Exception, Resolver, Interface)
Abstract base classes should use abc.ABC and @AbstractMethod for interfaces
Provide complete type annotations for all class attributes
Follow Google Python docstring style for modules, classes, and functions, including Args, Returns, Raises, Attributes sections as needed
Files:
tests/unit/metrics/test_utis.pytests/unit/utils/test_common.py
tests/{unit,integration}/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
tests/{unit,integration}/**/*.py: Use pytest for all unit and integration tests
Do not use unittest in tests; pytest is the standard
Files:
tests/unit/metrics/test_utis.pytests/unit/utils/test_common.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
tests/**/*.py: Use pytest-mock to create AsyncMock objects for async interactions in tests
Use the shared auth mock constant: MOCK_AUTH = ("mock_user_id", "mock_username", False, "mock_token") in tests
Files:
tests/unit/metrics/test_utis.pytests/unit/utils/test_common.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build-pr
- GitHub Check: e2e_tests (ci)
- GitHub Check: e2e_tests (azure)
Description
LCORE-739: added return type to unit tests
Type of change
Related Tickets & Documents
Summary by CodeRabbit