From 54bcefd7d79bacdb68d7514709d70d61a4dfa794 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 3 Oct 2022 19:33:05 +0100 Subject: [PATCH] Revert "Disable AnchorCheck plugin" This reverts commit 035652436949c7729e1957b9e2f013f0b868589a. --- linkcheck/plugins/anchorcheck.py | 8 -------- tests/checker/test_anchor.py | 4 ---- 2 files changed, 12 deletions(-) diff --git a/linkcheck/plugins/anchorcheck.py b/linkcheck/plugins/anchorcheck.py index 70f52d33..096fc638 100644 --- a/linkcheck/plugins/anchorcheck.py +++ b/linkcheck/plugins/anchorcheck.py @@ -26,16 +26,8 @@ from ..htmlutil import linkparse class AnchorCheck(_ContentPlugin): """Checks validity of HTML anchors.""" - def __init__(self, config): - """Initialize plugin.""" - super().__init__(config) - log.warn( - LOG_PLUGIN, _("Anchor check plugin is broken. Fixes welcome.") - ) - def applies_to(self, url_data): """Check for HTML anchor existence.""" - return False # XXX Plugin disabled return url_data.is_html() and url_data.anchor def check(self, url_data): diff --git a/tests/checker/test_anchor.py b/tests/checker/test_anchor.py index a354674f..7848e9e1 100644 --- a/tests/checker/test_anchor.py +++ b/tests/checker/test_anchor.py @@ -16,8 +16,6 @@ """ Test html anchor parsing and checking. """ -import pytest - from . import LinkCheckTest from .httpserver import HttpServerTest @@ -27,7 +25,6 @@ class TestAnchor(LinkCheckTest): Test anchor checking of HTML pages. """ - @pytest.mark.xfail(strict=True) def test_anchor(self): confargs = {"enabledplugins": ["AnchorCheck"]} url = "file://%(curdir)s/%(datadir)s/anchor.html" % self.get_attrs() @@ -49,7 +46,6 @@ class TestHttpAnchor(HttpServerTest): Test checking of HTML pages containing links to anchors served over http. """ - @pytest.mark.xfail(strict=True) def test_anchor_html(self): confargs = dict(enabledplugins=["AnchorCheck"], recursionlevel=1) self.file_test("http_anchor.html", confargs=confargs)