Spaces:
Running
Running
Commit History
-
Test the search URLs, and delete the harness that hid them
Claude +1: Claude Opus 5Unverified signatureThe Playwright tests drove a real browser through a wrapper that replaced `page.goto` with a stand-in accepting the URL and discarding it. So every scraper's navigation target was untested, and invisibly so: mutation testing showed that replacing the Bing URL with a constant, dropping `&num=` from the Scholar URL, and making the Google Patents URL ignore the query all left the full suite green. A scraper searching for the wrong thing entirely passed. Finish the fetch/parse split that scrap.py and _extract_bing_results had already started: - Each scraper's URL construction becomes a named pure builder (bing_search_url and friends), asserted directly in tests/test_serp_urls.py - query present, query encoded, result count honoured, expected host. 22 tests, no browser, 0.11s. All four URL mutants now fail the suite. - The extraction tests take an already-loaded page via a `page_factory` fixture using `set_content`, exactly as the bing test already did. This removes the need for…232eb80