Skip to content

Commit 22a8e11

Browse files
committed
Fix lint issues
Signed-off-by: Krishnaswamy Subramanian <subramk@thoughtworks.com>
1 parent 6b96f3b commit 22a8e11

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

test/core/execution/test_kubeflow.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def test_kubeflow_executor_stage_files(
411411
with patch.object(executor.packager, "package") as mock_package:
412412
mock_package.return_value = "configmap-name"
413413

414-
result = executor.stage_files(task_dir)
414+
executor.stage_files(task_dir)
415415

416416
# Verify the package method was called with correct arguments
417417
mock_package.assert_called_once()
@@ -1491,8 +1491,8 @@ def test_kubeflow_executor_configmap_lifecycle_management():
14911491
def test_kubeflow_executor_cluster_training_runtime_creation():
14921492
"""Test ClusterTrainingRuntime creation with experiment-specific configurations."""
14931493
# Mock Kubernetes setup at initialization time
1494-
with patch("kubernetes.config.load_incluster_config") as mock_load_incluster:
1495-
with patch("kubernetes.config.load_kube_config") as mock_load_kube:
1494+
with patch("kubernetes.config.load_incluster_config"):
1495+
with patch("kubernetes.config.load_kube_config"):
14961496
with patch("kubernetes.client.CoreV1Api") as mock_core_api:
14971497
# Mock successful Kubernetes setup
14981498
mock_core_api_instance = mock_core_api.return_value
@@ -1546,8 +1546,8 @@ def test_kubeflow_executor_trainjob_with_cluster_training_runtime():
15461546
def test_kubeflow_executor_resource_cleanup_complete():
15471547
"""Test complete resource cleanup including ConfigMaps, TrainJobs, and ClusterTrainingRuntime."""
15481548
# Mock Kubernetes setup at initialization time
1549-
with patch("kubernetes.config.load_incluster_config") as mock_load_incluster:
1550-
with patch("kubernetes.config.load_kube_config") as mock_load_kube:
1549+
with patch("kubernetes.config.load_incluster_config"):
1550+
with patch("kubernetes.config.load_kube_config"):
15511551
with patch("kubernetes.client.CoreV1Api") as mock_core_api:
15521552
# Mock successful Kubernetes setup
15531553
mock_core_api_instance = mock_core_api.return_value
@@ -1586,8 +1586,8 @@ def test_kubeflow_executor_resource_cleanup_complete():
15861586
def test_kubeflow_executor_cluster_training_runtime_configuration():
15871587
"""Test that ClusterTrainingRuntime is created with correct configuration."""
15881588
# Mock Kubernetes setup at initialization time
1589-
with patch("kubernetes.config.load_incluster_config") as mock_load_incluster:
1590-
with patch("kubernetes.config.load_kube_config") as mock_load_kube:
1589+
with patch("kubernetes.config.load_incluster_config"):
1590+
with patch("kubernetes.config.load_kube_config"):
15911591
with patch("kubernetes.client.CoreV1Api") as mock_core_api:
15921592
# Mock successful Kubernetes setup
15931593
mock_core_api_instance = mock_core_api.return_value
@@ -1609,7 +1609,7 @@ def test_kubeflow_executor_cluster_training_runtime_configuration():
16091609
mock_api_instance = mock_api.return_value
16101610
mock_api_instance.create_cluster_custom_object.return_value = None
16111611

1612-
runtime_name = executor._create_cluster_training_runtime()
1612+
executor._create_cluster_training_runtime()
16131613

16141614
# Verify the API call was made with correct parameters
16151615
mock_api_instance.create_cluster_custom_object.assert_called_once()
@@ -1631,8 +1631,8 @@ def test_kubeflow_executor_cluster_training_runtime_configuration():
16311631
def test_kubeflow_executor_cluster_training_runtime_minimal_configuration():
16321632
"""Test that ClusterTrainingRuntime is created with minimal configuration."""
16331633
# Mock Kubernetes setup at initialization time
1634-
with patch("kubernetes.config.load_incluster_config") as mock_load_incluster:
1635-
with patch("kubernetes.config.load_kube_config") as mock_load_kube:
1634+
with patch("kubernetes.config.load_incluster_config"):
1635+
with patch("kubernetes.config.load_kube_config"):
16361636
with patch("kubernetes.client.CoreV1Api") as mock_core_api:
16371637
# Mock successful Kubernetes setup
16381638
mock_core_api_instance = mock_core_api.return_value
@@ -1647,7 +1647,7 @@ def test_kubeflow_executor_cluster_training_runtime_minimal_configuration():
16471647
mock_api_instance = mock_api.return_value
16481648
mock_api_instance.create_cluster_custom_object.return_value = None
16491649

1650-
runtime_name = executor._create_cluster_training_runtime()
1650+
executor._create_cluster_training_runtime()
16511651

16521652
# Verify the API call was made with correct parameters
16531653
mock_api_instance.create_cluster_custom_object.assert_called_once()
@@ -1684,7 +1684,7 @@ def test_kubeflow_executor_resource_validation():
16841684

16851685
# Test with invalid resource configuration (should handle gracefully)
16861686
with pytest.raises(ValueError, match="nodes must be >= 1"):
1687-
executor_invalid = KubeflowExecutor(
1687+
KubeflowExecutor(
16881688
nodes=0, # Invalid: 0 nodes
16891689
)
16901690

@@ -1706,7 +1706,7 @@ def test_kubeflow_executor_resource_conflict_resolution():
17061706

17071707
# Should handle resource conflict and retry
17081708
with pytest.raises(Exception, match="Resource conflict"):
1709-
job_id = executor.submit(MagicMock(inline="print('hello')"), "conflict-job")
1709+
executor.submit(MagicMock(inline="print('hello')"), "conflict-job")
17101710

17111711

17121712
def test_kubeflow_executor_experiment_specific_configurations():
@@ -1725,7 +1725,6 @@ def test_kubeflow_executor_experiment_specific_configurations():
17251725
assert job_id == "job-specific"
17261726

17271727
# Verify experiment-specific runtime configuration
1728-
call_args = mock_create_trainjob.call_args
17291728
# The runtime should be configured with experiment-specific settings
17301729
assert executor.runtime_name == "experiment-runtime"
17311730
assert executor.nodes == 2

0 commit comments

Comments
 (0)