Skip to content

Commit 3968579

Browse files
committed
Cleanup imports in tests
1 parent 0eec2ff commit 3968579

24 files changed

+36
-72
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ jobs:
9898
uses: github/codeql-action/analyze@v3
9999
with:
100100
category: "/language:${{ matrix.language }}"
101-
upload: false
101+
upload: false

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
6060
echo "🚀 Launching container…"
6161
docker run -d --name mcpgateway -p 4444:4444 \
62-
mcpgateway/mcpgateway:latest
62+
-e HOST=0.0.0.0 mcpgateway/mcpgateway:latest
6363
6464
echo "⏳ Waiting for startup…"
6565
sleep 10

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ lint:
343343
## --------------------------------------------------------------------------- ##
344344
autoflake: ## 🧹 Strip unused imports / vars
345345
autoflake --in-place --remove-all-unused-imports \
346-
--remove-unused-variables -r mcpgateway
346+
--remove-unused-variables -r mcpgateway mcpgateway-wrapper tests
347347

348348
black: ## 🎨 Reformat code with black
349-
@echo "🎨 black …" && black -l 200 mcpgateway
349+
@echo "🎨 black …" && black -l 200 mcpgateway mcpgateway-wrapper tests
350350

351351
isort: ## 🔀 Sort imports
352352
@echo "🔀 isort …" && isort .
@@ -376,19 +376,19 @@ pre-commit: ## 🪄 Run pre-commit hooks
376376
pre-commit run --all-files --show-diff-on-failure
377377

378378
ruff: ## ⚡ Ruff lint + format
379-
ruff check mcpgateway && ruff format mcpgateway
379+
ruff check mcpgateway && ruff format mcpgateway mcpgateway-wrapper tests
380380

381381
ty: ## ⚡ Ty type checker
382-
ty check mcpgateway
382+
ty check mcpgateway mcpgateway-wrapper tests
383383

384384
pyright: ## 🏷️ Pyright type-checking
385-
pyright mcpgateway
385+
pyright mcpgateway mcpgateway-wrapper tests
386386

387387
radon: ## 📈 Complexity / MI metrics
388-
radon mi -s mcpgateway && \
389-
radon cc -s mcpgateway && \
390-
radon hal mcpgateway && \
391-
radon raw -s mcpgateway
388+
radon mi -s mcpgateway mcpgateway-wrapper tests && \
389+
radon cc -s mcpgateway mcpgateway-wrapper tests && \
390+
radon hal mcpgateway mcpgateway-wrapper tests && \
391+
radon raw -s mcpgateway mcpgateway-wrapper tests
392392

393393
pyroma: ## 📦 Packaging metadata check
394394
pyroma -d .
@@ -445,7 +445,7 @@ sbom: ## 🛡️ Generate SBOM & security report
445445

446446
pytype: ## 🧠 Pytype static type analysis
447447
@echo "🧠 Pytype analysis…"
448-
pytype -V 3.12 -j auto mcpgateway
448+
pytype -V 3.12 -j auto mcpgateway mcpgateway-wrapper tests
449449

450450
check-manifest: ## 📦 Verify MANIFEST.in completeness
451451
@echo "📦 Verifying MANIFEST.in completeness…"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ docker run -i --name mcpgateway-wrapper \
165165
"-e",
166166
"MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN}",
167167
"--entrypoint",
168-
"uv",
168+
"uv",
169169
"ghcr.io/ibm/mcp-context-forge:latest",
170170
"run",
171171
"--directory",
172-
"mcpgateway-wrapper",
172+
"mcpgateway-wrapper",
173173
"mcpgateway-wrapper"
174174
],
175175
"env": {

mcpgateway/version.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import subprocess
2626
import time
2727
from datetime import datetime
28-
from pathlib import Path
2928
from typing import Any, Dict, Optional
3029
from urllib.parse import urlsplit, urlunsplit
3130

test_readme.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import sys
1515
from pathlib import Path
1616

17-
import pytest
18-
1917
# Add the parent directory to the path so that we can import the module
2018
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
2119

tests/conftest.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
Authors: Mihai Criveti
77
88
"""
9+
910
import asyncio
1011
import os
11-
from typing import AsyncGenerator, Generator
12-
from unittest.mock import AsyncMock, MagicMock, patch
12+
from unittest.mock import AsyncMock, patch
1313

1414
import pytest
15-
from fastapi import FastAPI
1615
from sqlalchemy import create_engine
17-
from sqlalchemy.orm import Session, sessionmaker
16+
from sqlalchemy.orm import sessionmaker
1817

19-
from mcpgateway.config import Settings, get_settings
18+
from mcpgateway.config import Settings
2019
from mcpgateway.db import Base
2120

2221

tests/unit/mcpgateway/services/test_completion_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Authors: Mihai Criveti
77
88
"""
9+
910
import pytest
1011

1112
from mcpgateway.services.completion_service import ( # :contentReference[oaicite:0]{index=0}:contentReference[oaicite:1]{index=1}

tests/unit/mcpgateway/services/test_gateway_service.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@
88
Tests for the Gateway Service implementation.
99
"""
1010

11-
import asyncio
12-
from unittest.mock import AsyncMock, MagicMock, Mock, patch
11+
from unittest.mock import AsyncMock, MagicMock, Mock
1312

1413
import pytest
15-
from sqlalchemy import select
16-
from sqlalchemy.exc import IntegrityError
1714

1815
from mcpgateway.db import Gateway as DbGateway
1916
from mcpgateway.db import Tool as DbTool
20-
from mcpgateway.schemas import GatewayCreate, GatewayRead, GatewayUpdate
17+
from mcpgateway.schemas import GatewayCreate, GatewayUpdate
2118
from mcpgateway.services.gateway_service import (
2219
GatewayConnectionError,
2320
GatewayError,

tests/unit/mcpgateway/services/test_logging_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Authors: Mihai Criveti
77
88
"""
9+
910
import asyncio
1011
import logging
1112
from datetime import datetime

0 commit comments

Comments
 (0)