pryscraper/tests
opencode 025bcbbe9e fix(pry): test_check_selectors_empty → per-test fresh engine fixture
The module-level db._engine was being reused across tests. Tests that
went through the temp_db fixture wrote StructureSnapshot rows to a
tmp_path sqlite file, but test_check_selectors_empty runs without that
fixture, so on the second run the engine pointed at the polluted file
instead of starting empty — RuntimeError when StructureSnapshot rows
were queried.

Fix: add an autouse fixture that swaps the engine for a fresh
sqlite:///:memory: instance for every test in this file. The temp_db
fixture is preserved for tests that need a real file path.

Tests: 620 passed, 1 skipped, 1 deselected (was 619 passed + 2 failed).
2026-07-06 20:33:36 +07:00
..
__init__.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
conftest.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_adaptive.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_advanced_features.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_advanced_scraping.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_agency.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_ai_plugin.py feat(logging): add structlog + JSON logging (CONVENTIONS.md Part 5) 2026-07-02 20:55:41 +02:00
test_alerter.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_api.py feat(pry): phase 0 — split routers, add tests, apify schema, pry api key (#5) 2026-07-03 03:43:02 +02:00
test_api_integration.py fix(pry): test_ready_returns_200 → pytest.mark.integration 2026-07-06 20:08:27 +07:00
test_api_mcp.py feat(pry): production readiness pass — apify actor, async db, retry wiring, tests, observability, mypy 2026-07-03 14:41:41 +02:00
test_api_mcp_x402.py fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1) 2026-07-02 23:18:40 +02:00
test_api_scraping.py feat(db): add Alembic migrations (#6) 2026-07-03 02:22:33 +02:00
test_api_surface_snapshot.py style(tests): fix ruff lint errors in new snapshot/fallback/retry tests 2026-07-03 15:36:59 +02:00
test_api_templates.py feat(db): add Alembic migrations (#6) 2026-07-03 02:22:33 +02:00
test_apify_schema.py feat(db): add Alembic migrations (#6) 2026-07-03 02:22:33 +02:00
test_auth_connector.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_block_detector.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_cache.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_camoufox.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_commerce_sync.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_compliance.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_costing.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_crm_sync.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_db.py feat(db): add Alembic migrations (#6) 2026-07-03 02:22:33 +02:00
test_destinations.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_email_scraper.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_enrichment.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_extractor.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_fallback_integration.py style(tests): fix ruff lint errors in new snapshot/fallback/retry tests 2026-07-03 15:36:59 +02:00
test_freshness.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_gdpr.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_infrastructure.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_intelligence.py feat(sql): migrate intelligence, monitor, and referrals to SQLAlchemy (#4) 2026-07-03 01:29:59 +02:00
test_jobqueue.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_lazy_load.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_llm_fallback.py fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1) 2026-07-02 23:18:40 +02:00
test_llm_providers.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_logging_config.py fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1) 2026-07-02 23:18:40 +02:00
test_markdown_gen.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_marketplace.py chore(lint): auto-fix 253 of 283 ruff issues (F401, I001, E402, RUF100, UP037, SIM105) 2026-07-02 21:51:25 +02:00
test_mcp_production.py refactor(mcp): modernize imports to use pry_mcp sub-package directly 2026-07-03 15:18:11 +02:00
test_monitor.py feat(sql): migrate intelligence, monitor, and referrals to SQLAlchemy (#4) 2026-07-03 01:29:59 +02:00
test_network.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_parser.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_pipeline.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_pipelines.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_proxy_manager.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_quality.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_ratelimit.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_real_features.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_reconciliation.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_referrals.py feat(sql): migrate intelligence, monitor, and referrals to SQLAlchemy (#4) 2026-07-03 01:29:59 +02:00
test_reports.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_resilience.py feat(resilience): circuit breakers and per-domain tier memory 2026-07-03 11:49:33 +02:00
test_retry.py style(tests): fix ruff lint errors in new snapshot/fallback/retry tests 2026-07-03 15:36:59 +02:00
test_review.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_scraper.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_sdk.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_secrets_backend.py fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1) 2026-07-02 23:18:40 +02:00
test_seo_monitor.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_settings.py refactor(settings): unify config.py, mconfig.py, and settings.py into single PrySettings 2026-07-03 05:04:29 +02:00
test_shadow_dom.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_structure_monitor.py fix(pry): test_check_selectors_empty → per-test fresh engine fixture 2026-07-06 20:33:36 +07:00
test_templates.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_training_data.py chore(license): re-license to dual MIT (core) + BSL 1.1 (stealth) 2026-07-02 19:59:18 +02:00
test_ultimate_scraper.py style(tests): fix ruff lint errors in new snapshot/fallback/retry tests 2026-07-03 15:36:59 +02:00
test_url_guard.py feat(url_guard): SSRF and path traversal guard for scraper inputs 2026-07-03 12:00:40 +02:00
test_x402_mcp_spec.py refactor(mcp): modernize imports to use pry_mcp sub-package directly 2026-07-03 15:18:11 +02:00