Skip to content

Commit 5c9dcae

Browse files
committed
eli-366 further linting and fixing pre-commit
1 parent c83b42c commit 5c9dcae

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

scripts/config/pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ repos:
5151
language: script
5252
pass_filenames: false
5353
- repo: https://github.com/astral-sh/ruff-pre-commit
54-
rev: v0.9.7
54+
rev: v0.14.10
5555
hooks:
5656
- id: ruff
5757
args: [--fix]

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def iam_role(iam_client: BaseClient) -> Generator[str]:
228228

229229
@pytest.fixture(scope="session")
230230
def lambda_zip() -> Path:
231-
build_result = subprocess.run(["make", "build"], capture_output=True, text=True, check=False) # noqa: S603, S607
231+
build_result = subprocess.run(["make", "build"], capture_output=True, text=True, check=False) # noqa: S607
232232
assert build_result.returncode == 0, f"'make build' failed: {build_result.stderr}"
233233
return Path("dist/lambda.zip")
234234

tests/unit/logging/test_logs_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import pytest
66
from mangum.types import LambdaContext
77

8+
from eligibility_signposting_api.app import log_request_ids_from_headers
9+
810

911
@pytest.fixture
1012
def lambda_context():
@@ -46,8 +48,6 @@ def lambda_context():
4648
],
4749
)
4850
def test_log_request_ids_decorator_logs_metadata(headers, gateway_request_id, expected_extra, lambda_context, caplog):
49-
from eligibility_signposting_api.app import log_request_ids_from_headers
50-
5151
event = {"headers": headers}
5252
if gateway_request_id is not None:
5353
event["requestContext"] = {"requestId": gateway_request_id}

tests/unit/middleware/test_security_headers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from http import HTTPStatus
44

55
import pytest
6-
from flask import Flask
6+
from flask import Flask, make_response
77
from flask.testing import FlaskClient
88
from hamcrest import assert_that, contains_string, equal_to, has_entries, is_
99

@@ -152,8 +152,6 @@ def test_existing_headers_are_not_overridden(self) -> None:
152152

153153
@app.route("/test")
154154
def test_route():
155-
from flask import make_response
156-
157155
resp = make_response({"status": "ok"}, HTTPStatus.OK)
158156
resp.headers["Cache-Control"] = "public, max-age=3600"
159157
return resp

0 commit comments

Comments
 (0)