Skip to content

Tests fail when Docker daemon is unavailable (should skip Docker-dependent tests) #397

@SaitejaKommi

Description

@SaitejaKommi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions