diff --git a/src/scriv/linkcheck.py b/src/scriv/linkcheck.py index f92c7b8..4cd12a9 100644 --- a/src/scriv/linkcheck.py +++ b/src/scriv/linkcheck.py @@ -38,7 +38,7 @@ def check_one_link(url: str) -> None: """Check if a URL is reachable. Logs a warning if not.""" try: resp = requests.head(url, timeout=60, allow_redirects=True) - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: # pylint: disable=broad-exception-caught logger.warning(f"Failed check for {url!r}: {exc}") return diff --git a/tests/test_ghrel.py b/tests/test_ghrel.py index c2a7d1b..965e485 100644 --- a/tests/test_ghrel.py +++ b/tests/test_ghrel.py @@ -190,6 +190,17 @@ def test_bad_explicit_repo(cli_invoke, repo): assert str(result.exception) == f"Repo must be owner/reponame: {repo!r}" +def test_check_links(cli_invoke, scenario1, mocker): + mock_check_links = mocker.patch("scriv.ghrel.check_markdown_links") + cli_invoke(["github-release", "--all", "--dry-run", "--check-links"]) + assert mock_check_links.mock_calls == [ + call("A good release\n"), + call("Nothing to say.\n"), + call("A beginning\n"), + call("Very first.\n"), + ] + + @pytest.fixture() def no_actions(mock_create_release, mock_update_release, responses): """Check that nothing really happened."""