1111# _is_version_like helper
1212# ---------------------------------------------------------------------------
1313
14+
1415@pytest .mark .parametrize (
1516 "target,expected" ,
1617 [
@@ -30,6 +31,7 @@ def test_is_version_like(target: str, expected: bool):
3031# Parser – install subcommand
3132# ---------------------------------------------------------------------------
3233
34+
3335@pytest .fixture
3436def parser () -> ArgumentParser :
3537 return get_parser ()
@@ -102,6 +104,7 @@ def test_uninstall_subcommand_defaults(parser: ArgumentParser):
102104# Integration / functional tests
103105# ---------------------------------------------------------------------------
104106
107+
105108def test_main_no_args (monkeypatch : pytest .MonkeyPatch , capsys ):
106109 """``clang-tools`` with no args prints help."""
107110 monkeypatch .setattr (sys , "argv" , ["clang-tools" ])
@@ -138,9 +141,7 @@ def test_main_install_binary(monkeypatch: pytest.MonkeyPatch, tmp_path):
138141 assert bin_path .exists ()
139142
140143
141- def test_main_install_binary_requires_version (
142- monkeypatch : pytest .MonkeyPatch , capsys
143- ):
144+ def test_main_install_binary_requires_version (monkeypatch : pytest .MonkeyPatch , capsys ):
144145 """``--binary`` with a non-version target is an error."""
145146 monkeypatch .setattr (
146147 sys ,
@@ -153,9 +154,7 @@ def test_main_install_binary_requires_version(
153154 assert exit_code == 1
154155
155156
156- def test_main_install_binary_invalid_version (
157- monkeypatch : pytest .MonkeyPatch , capsys
158- ):
157+ def test_main_install_binary_invalid_version (monkeypatch : pytest .MonkeyPatch , capsys ):
159158 """``--binary`` with a non-version target shows error."""
160159 monkeypatch .setattr (
161160 sys ,
@@ -168,9 +167,7 @@ def test_main_install_binary_invalid_version(
168167 assert exit_code == 1
169168
170169
171- def test_main_install_binary_and_wheel_mutex (
172- monkeypatch : pytest .MonkeyPatch , capsys
173- ):
170+ def test_main_install_binary_and_wheel_mutex (monkeypatch : pytest .MonkeyPatch , capsys ):
174171 """``--binary`` and ``--wheel`` together is an error."""
175172 monkeypatch .setattr (
176173 sys ,
@@ -200,9 +197,7 @@ def test_main_install_wheel_success(monkeypatch: pytest.MonkeyPatch, capsys):
200197 assert result .err == ""
201198
202199
203- def test_main_install_wheel_unsupported_tool (
204- monkeypatch : pytest .MonkeyPatch , capsys
205- ):
200+ def test_main_install_wheel_unsupported_tool (monkeypatch : pytest .MonkeyPatch , capsys ):
206201 """``--wheel`` with a binary-only tool name shows error."""
207202 monkeypatch .setattr (
208203 sys ,
@@ -217,9 +212,7 @@ def test_main_install_wheel_unsupported_tool(
217212
218213def test_main_install_wheel_failure (monkeypatch : pytest .MonkeyPatch , capsys ):
219214 """``--wheel`` with a failing _wheel_install returns 1."""
220- monkeypatch .setattr (
221- "clang_tools.main._wheel_install" , lambda tools , ver : 1
222- )
215+ monkeypatch .setattr ("clang_tools.main._wheel_install" , lambda tools , ver : 1 )
223216 monkeypatch .setattr (
224217 sys ,
225218 "argv" ,
@@ -276,9 +269,7 @@ def mock_wheel(tools, version):
276269 assert tracked == [(["clang-tidy" ], "18" )]
277270
278271
279- def test_main_install_auto_detect_binary (
280- monkeypatch : pytest .MonkeyPatch , tmp_path
281- ):
272+ def test_main_install_auto_detect_binary (monkeypatch : pytest .MonkeyPatch , tmp_path ):
282273 """Auto-detect installs binary for version in supported range."""
283274 monkeypatch .chdir (tmp_path )
284275 monkeypatch .setattr (
@@ -328,9 +319,7 @@ def test_main_install_auto_detect_fallback(
328319 assert "falling back to wheel" in result .err
329320
330321
331- def test_main_install_auto_detect_non_version (
332- monkeypatch : pytest .MonkeyPatch , capsys
333- ):
322+ def test_main_install_auto_detect_non_version (monkeypatch : pytest .MonkeyPatch , capsys ):
334323 """Auto-detect treats non-version target as tool name (wheel install)."""
335324 tracked_install : list = []
336325
@@ -386,9 +375,7 @@ def test_main_install_auto_detect_invalid_version(
386375# ---- ``uninstall`` subcommand -----------------------------------------
387376
388377
389- def test_main_uninstall_subcommand (
390- monkeypatch : pytest .MonkeyPatch , tmp_path , capsys
391- ):
378+ def test_main_uninstall_subcommand (monkeypatch : pytest .MonkeyPatch , tmp_path , capsys ):
392379 """``clang-tools uninstall 12`` removes installed tools."""
393380 tool_name = "clang-format"
394381 version = "12"
0 commit comments