From d5d56f0f3e855cb6b2efe004185c4fb1272aa0ec Mon Sep 17 00:00:00 2001 From: Abdullah <5238256+motjuste@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:18:51 +0100 Subject: [PATCH] Remove empty if block when running on CPU The first change still confirms that the passed value for cpu_or_gpu is either cpu or gpu The second change doesn't have to, so the if block is removed --- tests/integration/test_dss.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/integration/test_dss.py b/tests/integration/test_dss.py index 05e5c4b..1a6031d 100644 --- a/tests/integration/test_dss.py +++ b/tests/integration/test_dss.py @@ -59,16 +59,13 @@ def test_status_before_initialize( # Check if the output indicates MLflow deployment is not ready assert "MLflow deployment: Not ready" in result.stdout - if is_cpu_or_gpu == "cpu": - # we don't care if gpu acceleration is enabled or not - pass - elif is_cpu_or_gpu == "gpu": + if is_cpu_or_gpu == "gpu": # Check if the output indicates GPU acceleration is enabled and captures a GPU model assert "GPU acceleration: Enabled" in result.stdout assert ( "NVIDIA" in result.stdout ) # This checks for the presence of NVIDIA in the log, assuming only NVIDIA GPUs are used. - else: + elif is_cpu_or_gpu != "cpu": raise ValueError(f"Invalid value for is_cpu_or_gpu: {is_cpu_or_gpu}") @@ -225,10 +222,7 @@ def test_status_after_initialize(is_cpu_or_gpu, cleanup_after_initialize) -> Non # Check for MLflow URL presence in the output assert "MLflow URL: http://" in result.stdout - if is_cpu_or_gpu == "cpu": - # we don't care if gpu acceleration is enabled or not - pass - elif is_cpu_or_gpu == "gpu": + if is_cpu_or_gpu == "gpu": # Check if the output indicates GPU acceleration is enabled and captures a GPU model assert "GPU acceleration: Enabled" in result.stdout assert (