Skip to content

test(docker): skip test_pool_recycle_config when deps are missing - #2564

Open
talelboussetta wants to merge 1 commit into
unclecode:developfrom
talelboussetta:fix/pool-recycle-test-skips-without-deps
Open

talelboussetta wants to merge 1 commit into
unclecode:developfrom
talelboussetta:fix/pool-recycle-test-skips-without-deps

Conversation

@talelboussetta

Copy link
Copy Markdown
Contributor

Summary

tests/docker/test_pool_recycle_config.py (added in #2232) imports crawl4ai at the top, above its pytest.importorskip("crawler_pool", reason="docker server deps not installed") guard. In an environment where the package's dependencies are missing, that import raises ModuleNotFoundError during collection and pytest stops with "Interrupted: 1 error during collection", instead of skipping the file as the guard intends.

This moves the crawl4ai import below the guard. Follow-up to #2232 (I noted this in review there).

List of files changed and why

  • tests/docker/test_pool_recycle_config.py - import BrowserConfig after importorskip, so a missing dependency skips the file.

How Has This Been Tested?

Bare venv (pytest, pyyaml, repo installed with --no-deps), pytest --collect-only tests/docker/test_pool_recycle_config.py:

  • before: ModuleNotFoundError: No module named 'pydantic', "Interrupted: 1 error during collection"
  • after: SKIPPED ... docker server deps not installed, "1 skipped"

With crawl4ai's deps but no docker server deps: 1 skipped before and after. With everything installed (docker requirements + pytest-asyncio): 5 passed before and after, rebased on current develop, so behaviour with deps present is unchanged.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The module imported crawl4ai at the top, above the pytest.importorskip
guard for crawler_pool. Without the package's dependencies installed, the
import raised ModuleNotFoundError during collection and the whole run was
interrupted, instead of skipping with "docker server deps not installed"
as the guard intends. Move the crawl4ai import below the guard.

Follow-up to unclecode#2232 (refs unclecode#2231).
Copilot AI balanced review requested due to automatic review settings November 15, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants