from __future__ import annotations import importlib.util import re from pathlib import Path def test_render_scraper_script_has_no_numeric_underscore_literals() -> None: agent_path = Path(__file__).resolve().parents[1] / "agent.py" spec = importlib.util.spec_from_file_location("agent", agent_path) assert spec is not None and spec.loader is not None module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) script = module._render_scraper_script( { "url": "https://example.com/", "selectors": {"title": "title"}, "max_pages": 1, "wait_seconds": 0, "output_format": "json", "headless": True, "user_agent": "SmokeTest", "respect_robots": True, "rate_limit_seconds": 0, "screenshot": False, "output_dir": "/workspace/outputs/seleniumbase-website-scraper", } ) numeric_underscore_literal = re.compile(r"(?