diff --git a/setup.cfg b/setup.cfg index 33c3e95a3..8ec8fbbf6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -82,7 +82,7 @@ plugins = [coverage:report] precision = 2 -fail_under = 97.69 +fail_under = 97.79 show_missing = true skip_covered = true exclude_lines = diff --git a/tests/test_cli.py b/tests/test_cli.py index 0d34d1d36..ae22fef6a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -91,10 +91,20 @@ def test_cli_call_multiprocess_run() -> None: mock_run.assert_called_once() +@pytest.fixture(params=(True, False)) +def uds_file( + tmp_path: Path, request: pytest.FixtureRequest +) -> Path: # pragma: py-win32 + file = tmp_path / "uvicorn.sock" + should_create_file = request.param + if should_create_file: + file.touch(exist_ok=True) + return file + + @pytest.mark.skipif(sys.platform == "win32", reason="require unix-like system") -def test_cli_uds(tmp_path: Path) -> None: # pragma: py-win32 +def test_cli_uds(uds_file: Path) -> None: # pragma: py-win32 runner = CliRunner() - uds_file = tmp_path / "uvicorn.sock" with mock.patch.object(Config, "bind_socket") as mock_bind_socket: with mock.patch.object(Multiprocess, "run") as mock_run: