From 15f87753ddde0b997ccc6c75ea16788e1bd180cf Mon Sep 17 00:00:00 2001 From: nuwangeek Date: Thu, 11 Sep 2025 05:22:12 +0530 Subject: [PATCH 1/3] removed pyproject.toml block to suppress warnings --- pyproject.toml | 12 ------------ 1 file changed, 12 deletions(-) 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 -] From 591232fe4d3622e0469ddc68c4a8af047de39113 Mon Sep 17 00:00:00 2001 From: nuwangeek Date: Thu, 11 Sep 2025 05:37:11 +0530 Subject: [PATCH 2/3] added modern wait strategy to the conftest --- tests/conftest.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7e7325d..6b1e9c3 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") From 9435643e2c331f051c1e5d11e508ffc34706a263 Mon Sep 17 00:00:00 2001 From: nuwangeek Date: Thu, 11 Sep 2025 05:37:45 +0530 Subject: [PATCH 3/3] fixed ruff lint issues --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6b1e9c3..a806261 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,13 +20,13 @@ def vault_container() -> Generator[VaultContainer, None, None]: """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