MCPcopy Index your code
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_lazy_load_invalid_backend

Function test_lazy_load_invalid_backend

tests/test_chromium.py:1024–1030  ·  view source on GitHub ↗

Test that lazy_load raises AttributeError if the scraping method for an invalid backend is missing.

(monkeypatch)

Source from the content-addressed store, hash-verified

1022
1023@pytest.mark.asyncio
1024async def test_lazy_load_invalid_backend(monkeypatch):
1025 """Test that lazy_load raises AttributeError if the scraping method for an invalid backend is missing."""
1026 # Create a loader instance with a backend that does not have a corresponding scraping method.
1027 loader = ChromiumLoader(["http://example.com"], backend="nonexistent")
1028 with pytest.raises(AttributeError):
1029 # lazy_load calls asyncio.run(scraping_fn(url)) for each URL.
1030 list(loader.lazy_load())
1031
1032
1033@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

lazy_loadMethod · 0.95
ChromiumLoaderClass · 0.90

Tested by

no test coverage detected