style: clean lint warnings introduced by parallel-queue change
- Drop unused `import json` from new test module (F401). - Remove unused `# noqa: BLE001` directives — project ruff config doesn't enable BLE001 so the suppressions were dead weight (RUF100 x3). - Replace `×` (U+00D7) with ASCII `x` in console output (RUF001). - Collapse seed-strategy if/else into ternary (SIM108). - Use `enumerate(as_completed(...), start=1)` for completion counter instead of manual `completed = 0; completed += 1` (SIM113). - Run `ruff format` on touched files. Pre-existing lint errors on master (PLC0415/PLR0915/SIM113 in unrelated commands) are untouched — separate cleanup PR if desired. Net delta of this branch over master: 0 new lint errors. All 374 tests still passing.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -258,9 +257,7 @@ def test_parallel_queue_from_yaml_input(tmp_path: Path, calls: list[dict[str, An
|
||||
"""parallel_queue can be set via --input YAML (mirrors other generate params)."""
|
||||
out = tmp_path / "img.png"
|
||||
yml = tmp_path / "spec.yml"
|
||||
yml.write_text(
|
||||
f'prompt: from-yaml\nmodel: x.safetensors\ncount: 3\nparallel_queue: 3\nseed: 7\noutput: "{out}"\n'
|
||||
)
|
||||
yml.write_text(f'prompt: from-yaml\nmodel: x.safetensors\ncount: 3\nparallel_queue: 3\nseed: 7\noutput: "{out}"\n')
|
||||
result = runner.invoke(app, ["generate", "--input", str(yml)])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert len(calls) == 3
|
||||
@@ -271,9 +268,7 @@ def test_cli_parallel_queue_overrides_yaml(tmp_path: Path, calls: list[dict[str,
|
||||
"""CLI --parallel-queue wins over YAML's parallel_queue (standard precedence)."""
|
||||
out = tmp_path / "img.png"
|
||||
yml = tmp_path / "spec.yml"
|
||||
yml.write_text(
|
||||
f'prompt: from-yaml\nmodel: x.safetensors\ncount: 2\nparallel_queue: 1\nseed: 10\noutput: "{out}"\n'
|
||||
)
|
||||
yml.write_text(f'prompt: from-yaml\nmodel: x.safetensors\ncount: 2\nparallel_queue: 1\nseed: 10\noutput: "{out}"\n')
|
||||
# YAML says P=1 (sequential), CLI overrides to P=2 (fanout)
|
||||
result = runner.invoke(app, ["generate", "--input", str(yml), "-P", "2"])
|
||||
assert result.exit_code == 0, result.output
|
||||
|
||||
Reference in New Issue
Block a user