diff --git a/pyproject.toml b/pyproject.toml index ef68b9e..7533f6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,15 +61,3 @@ reportUnusedImport = "warning" # Hygiene: warn, but don’t fail bui [[tool.pyright.overrides]] module = "tests/**" reportMissingTypeStubs = "warning" - -[tool.pytest.ini_options] -# Test configuration - completely suppress warnings including count -testpaths = ["tests"] -minversion = "8.0" -addopts = [ - "--strict-markers", - "--strict-config", - "-ra", # Show extra test summary info - "--disable-warnings", # Disable all warnings during test runs - "-p", "no:warnings" # Disable warnings plugin completely -] diff --git a/tests/conftest.py b/tests/conftest.py index 7e7325d..a806261 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ from pathlib import Path from typing import Dict, Generator from testcontainers.vault import VaultContainer # type: ignore +from testcontainers.core.wait_strategies import LogMessageWaitStrategy # type: ignore from loguru import logger import hvac # type: ignore @@ -17,10 +18,20 @@ @pytest.fixture(scope="session") def vault_container() -> Generator[VaultContainer, None, None]: - """Create a Vault container for testing.""" - with VaultContainer() as vault: - # Vault container is automatically ready when context manager exits - yield vault + """Create a Vault container for testing with modern wait strategies.""" + container = VaultContainer() + + container.waiting_for( + LogMessageWaitStrategy("Vault server started!") + .with_startup_timeout(60) + .with_poll_interval(0.5) + ) + + container.start() + try: + yield container + finally: + container.stop() @pytest.fixture(scope="session")