Bug: Tests fail when Docker is unavailable
Description
Running pytest on environments where Docker is not installed or not running currently raises a DockerException during fixture setup, causing the entire test suite to fail.
Docker-backed fixtures defined in conftest.py should first detect whether Docker is available and skip the dependent tests gracefully if it is not.
Expected Behavior
- Docker availability should be checked before initializing Docker containers.
- Tests that depend on Docker should be skipped when Docker is unavailable.
- The test report should show these tests as skipped, not failed.
Actual Behavior
pytest raises a DockerException during PostgresContainer fixture setup.
- This causes session-level errors, which fail the entire test run instead of skipping Docker-dependent tests.
Affected Files
conftest.py (fixtures using PostgresContainer)
conftest.py (Docker-backed test fixtures)
Suggested Fix
- Add a Docker availability check before starting containers.
- Use
pytest.skip() or conditional fixtures to skip tests when Docker is not accessible.
Bug: Tests fail when Docker is unavailable
Description
Running
pyteston environments where Docker is not installed or not running currently raises aDockerExceptionduring fixture setup, causing the entire test suite to fail.Docker-backed fixtures defined in
conftest.pyshould first detect whether Docker is available and skip the dependent tests gracefully if it is not.Expected Behavior
Actual Behavior
pytestraises aDockerExceptionduringPostgresContainerfixture setup.Affected Files
conftest.py(fixtures usingPostgresContainer)conftest.py(Docker-backed test fixtures)Suggested Fix
pytest.skip()or conditional fixtures to skip tests when Docker is not accessible.