Skip to content

Commit c4ccc0c

Browse files
committed
fix(fitness): remove unused mock variable assignments in tests
- Remove unused mock_wait_for variable assignment in test_fitness_check_with_timeout - Remove unused mock_exec variable assignment in test_gpu_check_runs_in_correct_order These variables were captured but never used in the test logic.
1 parent 7f31c04 commit c4ccc0c

8 files changed

Lines changed: 8 additions & 11 deletions

File tree

examples/endpoints/run_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
)
1818

1919
print(run_request)
20-
except TimeoutError as err:
20+
except TimeoutError:
2121
print("Job timed out.")

runpod/cli/groups/pod/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def sync_pods(source_pod_id, dest_pod_id, source_workspace, dest_workspace):
176176
_, stdout, _ = source_ssh.ssh.exec_command(f"test -f {archive_path} && echo 'created' || echo 'failed'")
177177
archive_result = stdout.read().decode().strip()
178178
if archive_result != 'created':
179-
click.echo(f"❌ Error: Failed to create archive on source pod")
179+
click.echo("❌ Error: Failed to create archive on source pod")
180180
return
181181

182182
# Get archive size for progress indication

runpod/cli/groups/project/starter_templates/llama2/src/handler.py

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

33
# pylint: skip-file
44

5-
import inspect
65

76
from transformers import HfApi
87

runpod/serverless/utils/rp_download.py

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

99
import os
10-
import re
1110
import uuid
1211
import zipfile
1312
from concurrent.futures import ThreadPoolExecutor

scripts/compare_benchmarks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ def compare_benchmarks(baseline_file: str, optimized_file: str):
8888
total_diff = baseline_counts["total"] - opt_counts["total"]
8989
filtered_diff = baseline_counts["filtered"] - opt_counts["filtered"]
9090

91-
print(f"Total modules loaded:")
91+
print("Total modules loaded:")
9292
print(
9393
f" Baseline: {baseline_counts['total']:>4} Optimized: {opt_counts['total']:>4} Δ: {total_diff:>4}"
9494
)
95-
print(f"Runpod modules loaded:")
95+
print("Runpod modules loaded:")
9696
print(
9797
f" Baseline: {baseline_counts['filtered']:>4} Optimized: {opt_counts['filtered']:>4} Δ: {filtered_diff:>4}"
9898
)

tests/test_cli/test_cli_groups/test_pod_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" Test CLI pod commands """
22

33
import unittest
4-
from unittest.mock import MagicMock, patch, mock_open
4+
from unittest.mock import MagicMock, patch
55

66
from click.testing import CliRunner
77
from prettytable import PrettyTable

tests/test_serverless/test_modules/test_fitness.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
fitness checks. Does NOT test integration with worker startup.
77
"""
88

9-
import asyncio
109
import pytest
11-
from unittest.mock import patch, MagicMock
10+
from unittest.mock import patch
1211

1312
from runpod.serverless.modules.rp_fitness import (
1413
register_fitness_check,

tests/test_serverless/test_modules/test_gpu_fitness_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def gpu_check():
196196
patch(
197197
"asyncio.wait_for",
198198
side_effect=TimeoutError()
199-
) as mock_wait_for, \
199+
), \
200200
patch(
201201
"runpod.serverless.modules.rp_gpu_fitness._run_gpu_test_fallback"
202202
) as mock_fallback:
@@ -256,7 +256,7 @@ async def gpu_check():
256256
with patch(
257257
"runpod.serverless.modules.rp_gpu_fitness._get_gpu_test_binary_path"
258258
) as mock_path, \
259-
patch("asyncio.create_subprocess_exec") as mock_exec, \
259+
patch("asyncio.create_subprocess_exec"), \
260260
patch("os.access", return_value=True):
261261
mock_path.return_value = None # Force fallback
262262
with patch(

0 commit comments

Comments
 (0)