Skip to content

Commit

Permalink
Remove empty if block when running on CPU
Browse files Browse the repository at this point in the history
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
  • Loading branch information
motjuste authored Dec 2, 2024
1 parent dd0784b commit d5d56f0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/integration/test_dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")


Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit d5d56f0

Please sign in to comment.