Skip to content

Commit 874955b

Browse files
mldangeloclaude
andcommitted
fix: address linting issues and add temp output to gitignore
- Fix line too long (123 > 120) in test_cli.py - Run ruff format on test files - Add tests/smoke/.temp-output/ to .gitignore Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7b188ee commit 874955b

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ htmlcov/
4242
.tox/
4343
.mypy_cache/
4444
.ruff_cache/
45+
tests/smoke/.temp-output/
4546

4647
# Distribution
4748
dist/

tests/smoke/test_smoke.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ class TestEvalCommand:
150150
def test_basic_eval(self):
151151
"""Test basic eval with echo provider."""
152152
config_path = CONFIGS_DIR / "basic.yaml"
153-
stdout, stderr, exit_code = run_promptfoo(
154-
["eval", "-c", str(config_path), "--no-cache"]
155-
)
153+
stdout, stderr, exit_code = run_promptfoo(["eval", "-c", str(config_path), "--no-cache"])
156154

157155
assert exit_code == 0, f"Eval failed:\nSTDOUT: {stdout}\nSTDERR: {stderr}"
158156
# Should show evaluation results
@@ -267,9 +265,7 @@ def test_verbose_flag(self):
267265
"""Test --verbose flag."""
268266
config_path = CONFIGS_DIR / "basic.yaml"
269267

270-
stdout, stderr, exit_code = run_promptfoo(
271-
["eval", "-c", str(config_path), "--verbose", "--no-cache"]
272-
)
268+
stdout, stderr, exit_code = run_promptfoo(["eval", "-c", str(config_path), "--verbose", "--no-cache"])
273269

274270
assert exit_code == 0
275271
# Verbose mode should produce output
@@ -283,9 +279,7 @@ def test_success_exit_code(self):
283279
"""Test exit code 0 when all assertions pass."""
284280
config_path = CONFIGS_DIR / "basic.yaml"
285281

286-
stdout, stderr, exit_code = run_promptfoo(
287-
["eval", "-c", str(config_path), "--no-cache"]
288-
)
282+
stdout, stderr, exit_code = run_promptfoo(["eval", "-c", str(config_path), "--no-cache"])
289283

290284
assert exit_code == 0
291285

@@ -365,9 +359,7 @@ def test_contains_assertion(self):
365359
"""Test contains assertion."""
366360
config_path = CONFIGS_DIR / "basic.yaml"
367361

368-
stdout, stderr, exit_code = run_promptfoo(
369-
["eval", "-c", str(config_path), "--no-cache"]
370-
)
362+
stdout, stderr, exit_code = run_promptfoo(["eval", "-c", str(config_path), "--no-cache"])
371363

372364
assert exit_code == 0
373365
# All assertions should pass
@@ -377,9 +369,7 @@ def test_multiple_assertions(self):
377369
"""Test multiple assertions in single test."""
378370
config_path = CONFIGS_DIR / "assertions.yaml"
379371

380-
stdout, stderr, exit_code = run_promptfoo(
381-
["eval", "-c", str(config_path), "--no-cache"]
382-
)
372+
stdout, stderr, exit_code = run_promptfoo(["eval", "-c", str(config_path), "--no-cache"])
383373

384374
assert exit_code == 0
385375

tests/test_cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ def test_find_external_promptfoo_prevents_recursion_windows(self, monkeypatch: p
268268
real_promptfoo = "C:\\npm\\prefix\\promptfoo.cmd"
269269

270270
monkeypatch.setattr(sys, "argv", [wrapper_path])
271-
monkeypatch.setenv("PATH", "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python312\\Scripts;C:\\npm\\prefix")
271+
test_path = "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python312\\Scripts;C:\\npm\\prefix"
272+
monkeypatch.setenv("PATH", test_path)
272273

273274
def mock_which(cmd: str, path: Optional[str] = None) -> Optional[str]:
274275
if cmd != "promptfoo":
@@ -471,9 +472,7 @@ def test_main_exits_when_neither_external_nor_npx_available(
471472
node_path = "C:\\Program Files\\nodejs\\node.exe" if sys.platform == "win32" else "/usr/bin/node"
472473

473474
monkeypatch.setattr(sys, "argv", ["promptfoo", "eval"])
474-
monkeypatch.setattr("shutil.which", lambda cmd, path=None: {
475-
"node": node_path
476-
}.get(cmd))
475+
monkeypatch.setattr("shutil.which", lambda cmd, path=None: {"node": node_path}.get(cmd))
477476

478477
with pytest.raises(SystemExit) as exc_info:
479478
main()

0 commit comments

Comments
 (0)