diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ec18f9..3dee0f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,9 +27,4 @@ jobs: python -m pip install --upgrade pip python -m pip install -e ".[dev]" - name: Build and test - # TEMPORARY: There are bugs in the upstream that cause the tests to fail - # so for now, this step will always succeed. This should be removed - # as soon as the tests can pass against a stable version of the - # upstream! - # run: pytest - run: pytest || true + run: pytest diff --git a/pyproject.toml b/pyproject.toml index 34ef139..58422d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -342,7 +342,7 @@ plugins = ["pydantic.mypy"] # Enable mypy plugin for Pydantic model [tool.pytest.ini_options] minversion = "6.0" -addopts = "-ra --cov=cforge --cov-report=html:htmlcov --cov-report=term" +addopts = "-ra --cov=cforge --cov-report=html:htmlcov --cov-report=term --cov-fail-under=100" testpaths = [ "tests",] filterwarnings = [ "error", # Turn ALL warnings into errors by default @@ -353,6 +353,10 @@ filterwarnings = [ "ignore: `regex` has been deprecated, please use `pattern` instead", # FastAPI upgraded needed upstream "ignore: Extra environment options are deprecated. Use a preconfigured jinja2.Environment instead.", # Jinja2 deprecation upstream "ignore:websockets.*is deprecated.*:DeprecationWarning", # websockets library upgrade needed upstream + "ignore:The argument signature for the.*PoolEvents.reset:sqlalchemy.exc.SADeprecationWarning", # sqlalchemy deprecation, fixed upstream in mcpgateway + "ignore: The HMAC key is 11 bytes long.*", # security warning from jwt + "ignore:unclosed database in.*:ResourceWarning", # sqlite3 connection leaked during mcpgateway import-time bootstrap + "ignore:Exception ignored in.*sqlite3.Connection.*:pytest.PytestUnraisableExceptionWarning", # same root cause as above ] # ── fawltydeps ───────────────────────────────────────────────────── diff --git a/tests/conftest.py b/tests/conftest.py index 21db999..ed8f8c8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -280,7 +280,7 @@ def authorized_mock_client(mock_client) -> Generator[None, None, None]: yield mock_client -@pytest.fixture +@pytest.fixture(autouse=True) def mock_settings() -> Generator[CLISettings, None, None]: """Provide a context manager for mocking settings.""" with tempfile.TemporaryDirectory(prefix="cforge_") as tmpdir: