Skip to content

Commit d78c57e

Browse files
authored
Merge pull request #1380 from tisnik/lcore-1556-fixed-docstrings
LCORE-1556: Fixed docstrings
2 parents b043837 + 3225959 commit d78c57e

16 files changed

Lines changed: 1 addition & 53 deletions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ disable = ["R0801"]
224224
extend-exclude = ["tests/profiles/syntax_error.py"]
225225

226226
[tool.ruff.lint]
227-
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005"]
227+
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005", "D202"]
228228

229229
[tool.ruff.lint.flake8-tidy-imports.banned-api]
230230
unittest = { msg = "use pytest instead of unittest" }

tests/integration/endpoints/test_config_integration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ async def test_config_endpoint_fails_without_configuration(
7575
test_request (Request): FastAPI request fixture
7676
test_auth (AuthTuple): noop authentication fixture
7777
"""
78-
7978
# Verify that HTTPException is raised when configuration is not loaded
8079
with pytest.raises(HTTPException) as exc_info:
8180
await config_endpoint_handler(auth=test_auth, request=test_request)

tests/integration/endpoints/test_health_integration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ async def test_health_readiness_client_error(
142142
test_response: FastAPI response object
143143
test_auth: noop authentication tuple
144144
"""
145-
146145
# Verify that RuntimeError propagates from the endpoint (not caught)
147146
with pytest.raises(RuntimeError) as exc_info:
148147
await readiness_probe_get_method(auth=test_auth, response=test_response)

tests/unit/app/endpoints/test_conversations_v2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def test_build_turn_without_tool_calls(self) -> None:
5757

5858
def test_build_turn_with_tool_calls(self) -> None:
5959
"""Test building a turn when tool calls and results are present."""
60-
6160
tool_calls = [
6261
ToolCallSummary(
6362
id="call_1",

tests/unit/app/endpoints/test_feedback.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def test_is_feedback_disabled(mocker: MockerFixture) -> None:
6060

6161
async def test_assert_feedback_enabled_disabled(mocker: MockerFixture) -> None:
6262
"""Test that assert_feedback_enabled raises HTTPException when feedback is disabled."""
63-
6463
# Simulate feedback being disabled
6564
mocker.patch("app.endpoints.feedback.is_feedback_enabled", return_value=False)
6665

@@ -74,7 +73,6 @@ async def test_assert_feedback_enabled_disabled(mocker: MockerFixture) -> None:
7473

7574
async def test_assert_feedback_enabled(mocker: MockerFixture) -> None:
7675
"""Test that assert_feedback_enabled does not raise an exception when feedback is enabled."""
77-
7876
# Simulate feedback being enabled
7977
mocker.patch("app.endpoints.feedback.is_feedback_enabled", return_value=True)
8078

@@ -101,7 +99,6 @@ async def test_feedback_endpoint_handler(
10199
mocker: MockerFixture, feedback_request_data: dict[str, Any]
102100
) -> None:
103101
"""Test that feedback_endpoint_handler processes feedback for different payloads."""
104-
105102
mock_authorization_resolvers(mocker)
106103

107104
# Mock the dependencies
@@ -200,7 +197,6 @@ def test_store_feedback(
200197
mocker: MockerFixture, feedback_request_data: dict[str, Any]
201198
) -> None:
202199
"""Test that store_feedback correctly stores various feedback payloads."""
203-
204200
configuration.user_data_collection_configuration.feedback_storage = "fake-path"
205201

206202
# Patch filesystem and helpers
@@ -248,7 +244,6 @@ def test_store_feedback_on_io_error(
248244
mocker: MockerFixture, feedback_request_data: dict[str, Any]
249245
) -> None:
250246
"""Test the OSError and IOError handlings during feedback storage."""
251-
252247
# non-writable path
253248
# avoid touching the real filesystem; simulate a permission error on open
254249
configuration.user_data_collection_configuration.feedback_storage = "fake-path"

tests/unit/app/endpoints/test_tools.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -839,22 +839,18 @@ class TestInputSchemaToParameters:
839839

840840
def test_none_schema(self) -> None:
841841
"""Test that None schema returns empty list."""
842-
843842
assert _input_schema_to_parameters(None) == []
844843

845844
def test_empty_schema(self) -> None:
846845
"""Test that empty dict returns empty list."""
847-
848846
assert _input_schema_to_parameters({}) == []
849847

850848
def test_schema_without_properties(self) -> None:
851849
"""Test that schema without properties returns empty list."""
852-
853850
assert _input_schema_to_parameters({"type": "object"}) == []
854851

855852
def test_single_required_param(self) -> None:
856853
"""Test conversion of a single required parameter."""
857-
858854
schema = {
859855
"type": "object",
860856
"properties": {
@@ -875,7 +871,6 @@ def test_single_required_param(self) -> None:
875871

876872
def test_optional_param_with_default(self) -> None:
877873
"""Test conversion of an optional parameter with a default value."""
878-
879874
schema = {
880875
"type": "object",
881876
"properties": {
@@ -896,7 +891,6 @@ def test_optional_param_with_default(self) -> None:
896891

897892
def test_multiple_params_mixed_required(self) -> None:
898893
"""Test conversion with a mix of required and optional parameters."""
899-
900894
schema = {
901895
"type": "object",
902896
"properties": {

tests/unit/authentication/test_k8s.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ async def test_auth_dependency_no_token_readiness_liveness_endpoints_2(
318318
For this test the skip_for_health_probes configuration parameter is set to
319319
False.
320320
"""
321-
322321
config_dict = {
323322
"name": "test",
324323
"service": {

tests/unit/authorization/test_resolvers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def claims_to_token(claims: dict) -> str:
2929
claims)>.foo_signature", where the payload is base64url-encoded without
3030
padding.
3131
"""
32-
3332
string_claims = json.dumps(claims)
3433
b64_encoded_claims = (
3534
base64.urlsafe_b64encode(string_claims.encode()).decode().rstrip("=")

tests/unit/metrics/test_utis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
async def test_setup_model_metrics(mocker: MockerFixture) -> None:
99
"""Test the setup_model_metrics function."""
10-
1110
# Mock the LlamaStackAsLibraryClient
1211
mock_client = mocker.patch(
1312
"client.AsyncLlamaStackClientHolder.get_client"

tests/unit/models/config/test_authentication_configuration.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
def test_authentication_configuration() -> None:
3232
"""Test the AuthenticationConfiguration constructor."""
33-
3433
auth_config = AuthenticationConfiguration(
3534
module=AUTH_MOD_NOOP,
3635
skip_tls_verification=False,
@@ -56,7 +55,6 @@ def test_authentication_configuration() -> None:
5655

5756
def test_authentication_configuration_rh_identity() -> None:
5857
"""Test the AuthenticationConfiguration with RH identity token."""
59-
6058
auth_config = AuthenticationConfiguration(
6159
module=AUTH_MOD_RH_IDENTITY,
6260
skip_tls_verification=False,
@@ -78,7 +76,6 @@ def test_authentication_configuration_rh_identity() -> None:
7876

7977
def test_authentication_configuration_rh_identity_default_value() -> None:
8078
"""Test the AuthenticationConfiguration with RH identity token."""
81-
8279
auth_config = AuthenticationConfiguration(
8380
module=AUTH_MOD_RH_IDENTITY,
8481
skip_tls_verification=False,
@@ -100,7 +97,6 @@ def test_authentication_configuration_rh_identity_default_value() -> None:
10097

10198
def test_authentication_configuration_rh_identity_one_entitlement() -> None:
10299
"""Test the AuthenticationConfiguration with RH identity token."""
103-
104100
auth_config = AuthenticationConfiguration(
105101
module=AUTH_MOD_RH_IDENTITY,
106102
skip_tls_verification=False,
@@ -122,7 +118,6 @@ def test_authentication_configuration_rh_identity_one_entitlement() -> None:
122118

123119
def test_authentication_configuration_rh_identity_more_entitlements() -> None:
124120
"""Test the AuthenticationConfiguration with RH identity token."""
125-
126121
auth_config = AuthenticationConfiguration(
127122
module=AUTH_MOD_RH_IDENTITY,
128123
skip_tls_verification=False,
@@ -156,7 +151,6 @@ def test_authentication_configuration_rh_identity_but_insufficient_config() -> N
156151
157152
Expects a ValidationError with the message "RH Identity configuration must be specified".
158153
"""
159-
160154
with pytest.raises(
161155
ValidationError, match="RH Identity configuration must be specified"
162156
):
@@ -171,7 +165,6 @@ def test_authentication_configuration_rh_identity_but_insufficient_config() -> N
171165

172166
def test_authentication_configuration_jwk_token() -> None:
173167
"""Test the AuthenticationConfiguration with JWK token."""
174-
175168
auth_config = AuthenticationConfiguration(
176169
module=AUTH_MOD_JWK_TOKEN,
177170
skip_tls_verification=False,
@@ -200,7 +193,6 @@ def test_authentication_configuration_jwk_token_but_insufficient_config() -> Non
200193
`module=AUTH_MOD_JWK_TOKEN` and an empty `JwkConfiguration` must raise a
201194
`ValidationError` containing the text "JwkConfiguration".
202195
"""
203-
204196
with pytest.raises(ValidationError, match="JwkConfiguration"):
205197
AuthenticationConfiguration(
206198
module=AUTH_MOD_JWK_TOKEN,
@@ -214,7 +206,6 @@ def test_authentication_configuration_jwk_token_but_insufficient_config() -> Non
214206

215207
def test_authentication_configuration_jwk_token_but_not_config() -> None:
216208
"""Test the AuthenticationConfiguration with JWK token."""
217-
218209
with pytest.raises(
219210
ValidationError,
220211
match="Value error, JWK configuration must be specified when using JWK token",
@@ -239,7 +230,6 @@ def test_authentication_configuration_jwk_broken_config() -> None:
239230
`jwk_config`, and asserts that accessing `jwk_configuration` raises
240231
ValueError with message "JWK configuration should not be None".
241232
"""
242-
243233
auth_config = AuthenticationConfiguration(
244234
module=AUTH_MOD_JWK_TOKEN,
245235
skip_tls_verification=False,
@@ -536,7 +526,6 @@ def test_authentication_configuration_in_config_jwktoken() -> None:
536526

537527
def test_authentication_configuration_api_token() -> None:
538528
"""Test the AuthenticationConfiguration with API Token."""
539-
540529
auth_config = AuthenticationConfiguration(
541530
module=AUTH_MOD_APIKEY_TOKEN,
542531
skip_tls_verification=False,
@@ -561,7 +550,6 @@ def test_authentication_configuration_api_token() -> None:
561550

562551
def test_authentication_configuration_api_key_but_insufficient_config() -> None:
563552
"""Test the AuthenticationConfiguration with API Token."""
564-
565553
with pytest.raises(
566554
ValidationError,
567555
match="API Key configuration section must be "

0 commit comments

Comments
 (0)