From ead3a1e4fa66abe65b107d3188538453030ea1af Mon Sep 17 00:00:00 2001 From: Freddy Heppell Date: Thu, 8 Aug 2024 17:45:44 +0100 Subject: [PATCH] fix flaky test --- tests/scrape/test_crawler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/scrape/test_crawler.py b/tests/scrape/test_crawler.py index 8dc06af..b5d5a73 100644 --- a/tests/scrape/test_crawler.py +++ b/tests/scrape/test_crawler.py @@ -1,3 +1,4 @@ +import json import logging from pathlib import Path @@ -30,9 +31,7 @@ def test_scrape_crawl(shared_datadir): assert crawl.get_link_abs_path() == expected_link_abs_path(root_path) assert (root_path / "url_cache.json").is_file() - assert (root_path / "url_cache.json").read_text() == ( - shared_datadir / "expected_url_cache.json" - ).read_text() + assert json.loads((root_path / "url_cache.json").read_text()) == json.loads((shared_datadir / "expected_url_cache.json" ).read_text()) def test_recrawl_different_version(caplog, shared_datadir: Path):