From 05b538fb6db5b5b928ccbc5aad3a2fb02ffc45e7 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Fri, 9 Oct 2026 20:26:24 +0500 Subject: [PATCH] Update :has() test expectations for the descendant axis step. --- tests/test_cssselect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cssselect.py b/tests/test_cssselect.py index 0508380..d5d9ec7 100644 --- a/tests/test_cssselect.py +++ b/tests/test_cssselect.py @@ -824,7 +824,7 @@ def xpath(css: str) -> str: "concat(' ', normalize-space(@class), ' '), ' foo ')) and (descendant::f)]" ) # Combinators inside a :has() argument - assert xpath("e:has(f g)") == "e[descendant::f/descendant-or-self::*/g]" + assert xpath("e:has(f g)") == "e[descendant::f/descendant::g]" assert xpath("e:has(> f > g)") == "e[./f/g]" assert xpath("e:has(~ f + g)") == ( "e[following-sibling::f/following-sibling::*" @@ -833,7 +833,7 @@ def xpath(css: str) -> str: # A leading "+" applies to the first step of the argument, so that any # further step is walked from the adjacent sibling. assert xpath("e:has(+ f g)") == ( - "e[following-sibling::*[1]/self::f/descendant-or-self::*/g]" + "e[following-sibling::*[1]/self::f/descendant::g]" ) # A relative selector list matches if any of its arguments does assert xpath("e:has(f, > g)") == "e[(descendant::f) or (./g)]"