Skip to content

chore: remove unused imports and normalize import style in test files#5879

Open
jonpspri wants to merge 3 commits into
IBM:mainfrom
jonpspri:chore/test-lint-hygiene
Open

chore: remove unused imports and normalize import style in test files#5879
jonpspri wants to merge 3 commits into
IBM:mainfrom
jonpspri:chore/test-lint-hygiene

Conversation

@jonpspri

Copy link
Copy Markdown
Collaborator

Summary

Remove unused imports and normalize import style across test files. These are purely cosmetic changes that improve code quality without affecting behavior.

Changes

  • Remove unused imports (e.g., HTMLResponse, AsyncMock, JSONResponse, time, etc.)
  • Normalize import style (e.g., import mcpgateway.db as dbfrom mcpgateway import db)
  • Remove redundant local imports when module-level imports exist
  • Minor whitespace/formatting adjustments

Files Changed (9 files)

  • tests/unit/mcpgateway/test_translate_helpers.py
  • tests/unit/mcpgateway/utils/test_check_schema_at_head.py
  • tests/unit/mcpgateway/middleware/test_password_change_enforcement.py
  • tests/unit/mcpgateway/test_observability.py
  • tests/unit/plugins/test_unified_pdp.py
  • tests/unit/mcpgateway/test_db.py
  • tests/loadtest/locustfile_rate_limiter_scale.py
  • tests/unit/mcpgateway/middleware/test_auth_middleware.py
  • tests/e2e/test_main_apis.py

Verification

  • pytest passes on all changed files
  • ruff check shows improvement (removes 6 lint errors)
  • Pre-commit hooks pass

Closes #5878

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Jonathan Springer <jps@s390x.com>
jonpspri added 2 commits July 25, 2026 13:52
The test_main_apis.py test_delete_resource assert 403 == 404 failure
is a pre-existing issue in CI (verified on run 30157564766). The PR
modifies test logic (URI lookup approach) in addition to the pure-lint
import removal (import time). The test fix attempt does not resolve
the underlying failure in CI's full-suite context.

test_main_apis.py is out of scope for a pure-lint PR — pre-existing
e2e failures are tracked separately. This leaves 8 verified-pure-lint
files in the PR (locustfile, test_auth_middleware, test_db,
test_observability, test_translate_helpers, test_check_schema_at_head,
test_password_change_enforcement, test_unified_pdp).

Signed-off-by: Jonathan Springer <jps@s390x.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: Test hygiene — remove unused imports and normalize import style in test files

1 participant