From 743a5f31cb6a709622f7a78380547669709705cc Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Wed, 1 Feb 2017 19:19:53 +0200 Subject: [PATCH] Crawl HTML attributes in deterministic order Fixes #17. --- linkcheck/htmlutil/linkparse.py | 2 +- tests/checker/test_http.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/linkcheck/htmlutil/linkparse.py b/linkcheck/htmlutil/linkparse.py index d84644f3..9978e6aa 100644 --- a/linkcheck/htmlutil/linkparse.py +++ b/linkcheck/htmlutil/linkparse.py @@ -208,7 +208,7 @@ class LinkFinder (TagFinder): self.base_ref = attrs.get_true("href", u'') tagattrs = self.tags.get(tag, self.universal_attrs) # parse URLs in tag (possibly multiple URLs in CSS styles) - for attr in tagattrs.intersection(attrs): + for attr in sorted(tagattrs.intersection(attrs)): if tag == "meta" and not is_meta_url(attr, attrs): continue if tag == "form" and not is_form_get(attr, attrs): diff --git a/tests/checker/test_http.py b/tests/checker/test_http.py index 42edff1a..e4c1e097 100644 --- a/tests/checker/test_http.py +++ b/tests/checker/test_http.py @@ -29,7 +29,6 @@ class TestHttp (HttpServerTest): super(TestHttp, self).__init__(methodName=methodName) self.handler = CookieRedirectHttpRequestHandler - @pytest.mark.xfail(reason="fails non-deterministically") def test_html (self): confargs = dict(recursionlevel=1) self.file_test("http.html", confargs=confargs)