Repository navigation
test(docker): skip test_pool_recycle_config when deps are missing - #2564
Open
talelboussetta wants to merge 1 commit into
Open
talelboussetta wants to merge 1 commit into
talelboussetta wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/docker/test_pool_recycle_config.py(added in #2232) importscrawl4aiat the top, above itspytest.importorskip("crawler_pool", reason="docker server deps not installed")guard. In an environment where the package's dependencies are missing, that import raisesModuleNotFoundErrorduring collection and pytest stops with "Interrupted: 1 error during collection", instead of skipping the file as the guard intends.This moves the
crawl4aiimport 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- importBrowserConfigafterimportorskip, 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:ModuleNotFoundError: No module named 'pydantic', "Interrupted: 1 error during collection"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