fix: resolve CI formatting issues in tests/conftest.py
Some checks failed
CI / test (push) Failing after 12s
CI / lint (push) Failing after 5s
CI / type-check (push) Failing after 10s

- Remove unused typing imports (Dict, Any, List)
- Fix trailing whitespace on import lines
- Fix blank lines containing whitespace
- Sort import block correctly
This commit is contained in:
2026-02-04 13:55:31 +00:00
parent 489dcc863b
commit 6cfff16956

View File

@@ -1,20 +1,13 @@
"""Test configuration and fixtures."""
import json import json
import os import os
import tempfile import tempfile
from typing import Dict, Any, List
import pytest import pytest
from api_snapshot.recorder.recorder import ( from api_snapshot.recorder.recorder import RecordedRequest, RecordedResponse, RequestResponsePair
RecordedRequest, from api_snapshot.snapshot.manager import Snapshot, SnapshotManager, SnapshotMetadata
RecordedResponse,
RequestResponsePair
)
from api_snapshot.snapshot.manager import (
Snapshot,
SnapshotMetadata,
SnapshotManager
)
@pytest.fixture @pytest.fixture
@@ -119,11 +112,11 @@ def snapshot_file(temp_dir):
} }
] ]
} }
path = os.path.join(temp_dir, "test_snapshot.json") path = os.path.join(temp_dir, "test_snapshot.json")
with open(path, "w") as f: with open(path, "w") as f:
json.dump(data, f) json.dump(data, f)
return path return path
@@ -131,9 +124,9 @@ def snapshot_file(temp_dir):
def multiple_endpoints_snapshot(temp_dir): def multiple_endpoints_snapshot(temp_dir):
"""Create a snapshot with multiple endpoints.""" """Create a snapshot with multiple endpoints."""
manager = SnapshotManager(temp_dir) manager = SnapshotManager(temp_dir)
pairs = [] pairs = []
for i in range(3): for i in range(3):
req = RecordedRequest( req = RecordedRequest(
method=["GET", "POST", "DELETE"][i], method=["GET", "POST", "DELETE"][i],
@@ -148,6 +141,6 @@ def multiple_endpoints_snapshot(temp_dir):
latency_ms=50 * (i + 1) latency_ms=50 * (i + 1)
) )
pairs.append(RequestResponsePair(request=req, response=resp)) pairs.append(RequestResponsePair(request=req, response=resp))
manager.save_snapshot("multi-endpoint", requests=pairs, description="Multiple endpoints") manager.save_snapshot("multi-endpoint", requests=pairs, description="Multiple endpoints")
return manager return manager