Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ line-length = 88
extend-exclude = ["tests/profiles/syntax_error.py"]

[tool.ruff.lint]
extend-select = ["C", "FA", "FLY", "I", "TID251", "UP006", "UP007", "UP008", "UP010", "UP012", "UP017", "UP024", "UP035", "UP040", "UP041", "RUF100", "B009", "B010", "B011", "BLE", "DTZ005", "D202", "PLR1733", "RUF022", "PLW1510", "TC004", "PIE790", "PERF402", "FURB129", "RET501", "LOG"]
extend-select = ["C", "FA", "FLY", "I", "ISC001", "TID251", "UP006", "UP007", "UP008", "UP010", "UP012", "UP017", "UP024", "UP035", "UP040", "UP041", "RUF100", "B009", "B010", "B011", "BLE", "DTZ005", "D202", "PLR1733", "RUF022", "PLW1510", "TC004", "PIE790", "PERF402", "FURB129", "RET501", "LOG"]
ignore = ["UP047", "UP045", "S", "C901", "RUF", "SIM", "B017", "TRY004", "TRY201", "TRY203", "TRY401", "B008", "EXE001", "G201", "ISC004", "PYI034", "PYI064"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/features/steps/okp_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ def check_tool_call_name(context: Context, name: str) -> None:
tool_calls = _get_tool_calls(context)
assert tool_calls, "No tool_calls to check"
names = [tc.get("name") for tc in tool_calls]
assert name in names, (
f"Expected tool_call with name {name!r}, " f"but found names {names!r}"
)
assert (
name in names
), f"Expected tool_call with name {name!r}, but found names {names!r}"


# ── Then Steps: Content and Results Assertions ──
Expand Down
12 changes: 5 additions & 7 deletions tests/e2e/features/steps/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _deploy_cluster_tunnel_proxy() -> None:
print(result.stdout, end="")
if result.returncode != 0:
raise AssertionError(
"Failed to deploy e2e-tunnel-proxy: " f"{result.stderr or result.stdout}"
f"Failed to deploy e2e-tunnel-proxy: {result.stderr or result.stdout}"
)
os.environ.setdefault(
"E2E_PROXY_HOST",
Expand Down Expand Up @@ -618,9 +618,7 @@ def configure_ogx_ciphers(context: Context, ciphers: str) -> None:
# --- Proxy Verification Steps ---


@then(
"The tunnel proxy handled at least {count:d} " "CONNECT request to the LLM provider"
)
@then("The tunnel proxy handled at least {count:d} CONNECT request to the LLM provider")
def verify_tunnel_proxy_used(context: Context, count: int) -> None:
"""Verify the tunnel proxy received CONNECT requests."""
if is_prow_environment():
Expand All @@ -634,9 +632,9 @@ def verify_tunnel_proxy_used(context: Context, count: int) -> None:
return

proxy = context.tunnel_proxy
assert proxy.connect_count >= count, (
f"Expected at least {count} CONNECT requests, " f"got {proxy.connect_count}"
)
assert (
proxy.connect_count >= count
), f"Expected at least {count} CONNECT requests, got {proxy.connect_count}"
assert proxy.last_connect_target is not None, "No CONNECT target recorded"


Expand Down
12 changes: 3 additions & 9 deletions tests/unit/utils/test_saved_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,23 @@ def test_rejects_count_equal_to_max(self) -> None:
"""Test create is rejected when current count equals the inclusive max."""
with pytest.raises(
SavedPromptLimitExceededError,
match=(
r"Saved prompt limit exceeded: 50 existing prompts, " r"maximum is 50"
),
match=(r"Saved prompt limit exceeded: 50 existing prompts, maximum is 50"),
):
validate_saved_prompt_quota(50, 50)

def test_rejects_count_above_max(self) -> None:
"""Test create is rejected when current count is above the max."""
with pytest.raises(
SavedPromptLimitExceededError,
match=(
r"Saved prompt limit exceeded: 51 existing prompts, " r"maximum is 50"
),
match=(r"Saved prompt limit exceeded: 51 existing prompts, maximum is 50"),
):
validate_saved_prompt_quota(51, 50)

def test_rejects_when_max_is_zero(self) -> None:
"""Test max_prompts_per_user of 0 rejects even a zero current count."""
with pytest.raises(
SavedPromptLimitExceededError,
match=(
r"Saved prompt limit exceeded: 0 existing prompts, " r"maximum is 0"
),
match=(r"Saved prompt limit exceeded: 0 existing prompts, maximum is 0"),
):
validate_saved_prompt_quota(0, 0)

Expand Down
Loading