Skip to content

Commit 3f36891

Browse files
mattgodboltclaude
andcommitted
Fix test failures after click migration
- Update test_cli_utils.py to use new _filter_compilers signature - Changed from passing Mock args object to direct parameters - Remove unused Mock import - All tests now pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f63e3a9 commit 3f36891

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

prompt_testing/test_cli_utils.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for CLI utility functions."""
22

33
import json
4-
from unittest.mock import Mock
54

65
from prompt_testing.cli import _filter_compilers, _generate_compiler_mapping
76

@@ -24,11 +23,8 @@ def test_filter_compilers_by_instruction_set(capsys):
2423
MockCompiler("gcc3", "GCC 3", "x86_64"),
2524
]
2625

27-
# Mock args
28-
args = Mock(instruction_set="x86_64", search=None)
29-
3026
# Filter
31-
filtered = _filter_compilers(compilers, args)
27+
filtered = _filter_compilers(compilers, "x86_64", None)
3228

3329
# Should only have x86_64 compilers
3430
assert len(filtered) == 2
@@ -48,15 +44,13 @@ def test_filter_compilers_by_search(capsys):
4844
]
4945

5046
# Search for "gcc"
51-
args = Mock(instruction_set=None, search="gcc")
52-
filtered = _filter_compilers(compilers, args)
47+
filtered = _filter_compilers(compilers, None, "gcc")
5348

5449
assert len(filtered) == 2
5550
assert all("gcc" in c.name.lower() for c in filtered)
5651

5752
# Search by ID
58-
args = Mock(instruction_set=None, search="clang1500")
59-
filtered = _filter_compilers(compilers, args)
53+
filtered = _filter_compilers(compilers, None, "clang1500")
6054

6155
assert len(filtered) == 1
6256
assert filtered[0].id == "clang1500"
@@ -71,8 +65,7 @@ def test_filter_compilers_combined(capsys):
7165
]
7266

7367
# Filter by instruction set AND search
74-
args = Mock(instruction_set="x86_64", search="gcc")
75-
filtered = _filter_compilers(compilers, args)
68+
filtered = _filter_compilers(compilers, "x86_64", "gcc")
7669

7770
assert len(filtered) == 1
7871
assert filtered[0].id == "gcc1"

0 commit comments

Comments
 (0)