@@ -2293,6 +2293,19 @@ def test_added(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
22932293 "☐ Run 'uv run pyproject-fmt pyproject.toml' to run pyproject-fmt.\n "
22942294 )
22952295
2296+ class TestNoApply :
2297+ @pytest .mark .usefixtures ("_vary_network_conn" )
2298+ def test_skips_apply (
2299+ self , uv_init_dir : Path , capfd : pytest .CaptureFixture [str ]
2300+ ):
2301+ # Act
2302+ with change_cwd (uv_init_dir ), PyprojectTOMLManager ():
2303+ use_pyproject_fmt (no_apply = True )
2304+
2305+ # Assert
2306+ out , _ = capfd .readouterr ()
2307+ assert "Running pyproject-fmt" not in out
2308+
22962309 @pytest .mark .usefixtures ("_vary_network_conn" )
22972310 def test_pre_commit_integration (
22982311 self , uv_init_dir : Path , capfd : pytest .CaptureFixture [str ]
@@ -3167,6 +3180,16 @@ def test_stdout(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
31673180 "☐ Run 'uv run ruff format' to run the Ruff formatter.\n "
31683181 )
31693182
3183+ @pytest .mark .usefixtures ("_vary_network_conn" )
3184+ def test_no_apply (self , uv_init_dir : Path , capfd : pytest .CaptureFixture [str ]):
3185+ # Act
3186+ with change_cwd (uv_init_dir ), files_manager ():
3187+ use_ruff (no_apply = True )
3188+
3189+ # Assert
3190+ out , _ = capfd .readouterr ()
3191+ assert "Running the Ruff formatter" not in out
3192+
31703193 @pytest .mark .usefixtures ("_vary_network_conn" )
31713194 def test_pre_commit_first (self , uv_init_repo_dir : Path ):
31723195 # Act
0 commit comments