From eaae59fbefc3943ae279f24372228d6c65bc407e Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Fri, 27 Jun 2025 16:05:02 +0500 Subject: [PATCH] Fix invalid XML samples in tests that break with lxml 6. (#6919) --- tests/spiders.py | 4 ++-- tests/test_linkextractors.py | 6 +++--- tests/test_spider.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/spiders.py b/tests/spiders.py index c47f2bd2b..43cdcaef3 100644 --- a/tests/spiders.py +++ b/tests/spiders.py @@ -418,7 +418,7 @@ class CrawlSpiderWithParseMethod(MockServerSpider, CrawlSpider): async def start(self): test_body = b""" - Page title<title></head> + <head><title>Page title

Item 200

Item 201

@@ -472,7 +472,7 @@ class CrawlSpiderWithErrback(CrawlSpiderWithParseMethod): async def start(self): test_body = b""" - Page title<title></head> + <head><title>Page title

Item 200

Item 201

diff --git a/tests/test_linkextractors.py b/tests/test_linkextractors.py index 1bff369af..15d358d2a 100644 --- a/tests/test_linkextractors.py +++ b/tests/test_linkextractors.py @@ -152,7 +152,7 @@ class Base: def test_nofollow(self): """Test the extractor's behaviour for links with rel='nofollow'""" - html = b"""Page title<title> + html = b"""<html><head><title>Page title