@@ -25,6 +25,7 @@ class Args:
2525# _is_version_like helper
2626# ---------------------------------------------------------------------------
2727
28+
2829@pytest .mark .parametrize (
2930 "target,expected" ,
3031 [
@@ -44,6 +45,7 @@ def test_is_version_like(target: str, expected: bool):
4445# Parser – new subcommands
4546# ---------------------------------------------------------------------------
4647
48+
4749@pytest .fixture
4850def parser () -> ArgumentParser :
4951 return get_parser ()
@@ -116,6 +118,7 @@ def test_uninstall_subcommand_defaults(parser: ArgumentParser):
116118# Backward-compat legacy flags (still work)
117119# ---------------------------------------------------------------------------
118120
121+
119122@pytest .mark .parametrize ("arg_name" , ["install" , "uninstall" ])
120123@pytest .mark .parametrize ("arg_value" , [str (v ) for v in range (7 , 17 )])
121124def test_legacy_arg_parser (arg_name : str , arg_value : str , parser : ArgumentParser ):
@@ -142,6 +145,7 @@ def test_legacy_default_args(parser: ArgumentParser):
142145# Integration / functional tests
143146# ---------------------------------------------------------------------------
144147
148+
145149def test_main_no_args (monkeypatch : pytest .MonkeyPatch , capsys ):
146150 """``clang-tools`` with no args prints help."""
147151 monkeypatch .setattr (sys , "argv" , ["clang-tools" ])
@@ -151,9 +155,7 @@ def test_main_no_args(monkeypatch: pytest.MonkeyPatch, capsys):
151155 assert exit_code == 0
152156
153157
154- def test_main_legacy_uninstall (
155- monkeypatch : pytest .MonkeyPatch , tmp_path , capsys
156- ):
158+ def test_main_legacy_uninstall (monkeypatch : pytest .MonkeyPatch , tmp_path , capsys ):
157159 """Legacy ``--uninstall`` flag still works."""
158160 tool_name = "clang-format"
159161 version = "12"
@@ -203,9 +205,7 @@ def test_main_legacy_install(monkeypatch: pytest.MonkeyPatch, tmp_path):
203205 assert bin_path .exists ()
204206
205207
206- def test_main_legacy_install_invalid_version (
207- monkeypatch : pytest .MonkeyPatch , capsys
208- ):
208+ def test_main_legacy_install_invalid_version (monkeypatch : pytest .MonkeyPatch , capsys ):
209209 """Legacy ``--install`` with invalid version shows error."""
210210 monkeypatch .setattr (
211211 sys ,
@@ -251,9 +251,7 @@ def test_main_install_binary(monkeypatch: pytest.MonkeyPatch, tmp_path):
251251 assert bin_path .exists ()
252252
253253
254- def test_main_install_binary_requires_version (
255- monkeypatch : pytest .MonkeyPatch , capsys
256- ):
254+ def test_main_install_binary_requires_version (monkeypatch : pytest .MonkeyPatch , capsys ):
257255 """``--binary`` with a non-version target is an error."""
258256 monkeypatch .setattr (
259257 sys ,
@@ -271,9 +269,7 @@ def test_main_install_binary_requires_version(
271269 assert exit_code == 1
272270
273271
274- def test_main_install_binary_invalid_version (
275- monkeypatch : pytest .MonkeyPatch , capsys
276- ):
272+ def test_main_install_binary_invalid_version (monkeypatch : pytest .MonkeyPatch , capsys ):
277273 """``--binary`` with a non-version target shows 'requires a version number'."""
278274 monkeypatch .setattr (
279275 sys ,
@@ -291,9 +287,7 @@ def test_main_install_binary_invalid_version(
291287 assert exit_code == 1
292288
293289
294- def test_main_install_binary_and_wheel_mutex (
295- monkeypatch : pytest .MonkeyPatch , capsys
296- ):
290+ def test_main_install_binary_and_wheel_mutex (monkeypatch : pytest .MonkeyPatch , capsys ):
297291 """``--binary`` and ``--wheel`` together is an error."""
298292 monkeypatch .setattr (
299293 sys ,
@@ -331,9 +325,7 @@ def test_main_install_wheel_success(monkeypatch: pytest.MonkeyPatch, capsys):
331325
332326def test_main_install_wheel_failure (monkeypatch : pytest .MonkeyPatch , capsys ):
333327 """``--wheel`` with a failing _wheel_install returns 1."""
334- monkeypatch .setattr (
335- "clang_tools.main._wheel_install" , lambda tools , ver : 1
336- )
328+ monkeypatch .setattr ("clang_tools.main._wheel_install" , lambda tools , ver : 1 )
337329 monkeypatch .setattr (
338330 sys ,
339331 "argv" ,
@@ -390,9 +382,7 @@ def mock_wheel(tools, version):
390382 assert tracked == [(["clang-tidy" ], "18" )]
391383
392384
393- def test_main_install_auto_detect_binary (
394- monkeypatch : pytest .MonkeyPatch , tmp_path
395- ):
385+ def test_main_install_auto_detect_binary (monkeypatch : pytest .MonkeyPatch , tmp_path ):
396386 """Auto-detect installs binary for version in supported range."""
397387 monkeypatch .chdir (tmp_path )
398388 monkeypatch .setattr (
@@ -443,9 +433,7 @@ def test_main_install_auto_detect_fallback(
443433 assert "falling back to wheel" in result .err
444434
445435
446- def test_main_install_auto_detect_non_version (
447- monkeypatch : pytest .MonkeyPatch , capsys
448- ):
436+ def test_main_install_auto_detect_non_version (monkeypatch : pytest .MonkeyPatch , capsys ):
449437 """Auto-detect treats non-version target as tool name (wheel install)."""
450438 tracked_install : list = []
451439
@@ -510,9 +498,7 @@ def test_main_install_auto_detect_invalid_version(
510498# ---- New ``uninstall`` subcommand -------------------------------------
511499
512500
513- def test_main_uninstall_subcommand (
514- monkeypatch : pytest .MonkeyPatch , tmp_path , capsys
515- ):
501+ def test_main_uninstall_subcommand (monkeypatch : pytest .MonkeyPatch , tmp_path , capsys ):
516502 """``clang-tools uninstall 12`` removes installed tools."""
517503 tool_name = "clang-format"
518504 version = "12"
0 commit comments