Skip to content

Commit cbe7afa

Browse files
committed
fix(validation): satisfy mypy for PDP validation and tests
- Add unreachable return after with block in _validate_pdp_with_edvise_read - Use cast(Any, ...) in tests that pass non-callables to converter params Made-with: Cursor
1 parent e2f2e9c commit cbe7afa

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/webapp/validation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,8 @@ def _validate_pdp_with_edvise_read(
996996
failure_cases=[str(e)],
997997
) from e
998998

999+
return {} # Unreachable: every path above returns or raises
1000+
9991001

10001002
# --------------------------------------------------------------------------- #
10011003
# Main validation

src/webapp/validation_pdp_read_path_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io
44
from pathlib import Path
5+
from typing import Any, cast
56
from unittest.mock import patch
67

78
import pandas as pd
@@ -310,7 +311,7 @@ def test_validate_pdp_with_edvise_read_non_callable_cohort_converter_raises_hard
310311
enc="utf-8",
311312
model_list=["STUDENT"],
312313
institution_id="pdp",
313-
pdp_cohort_converter_func="not a function",
314+
pdp_cohort_converter_func=cast(Any, "not a function"),
314315
)
315316

316317

@@ -327,7 +328,7 @@ def test_validate_pdp_with_edvise_read_non_callable_course_converter_raises_hard
327328
enc="utf-8",
328329
model_list=["COURSE"],
329330
institution_id="pdp",
330-
pdp_course_converter_func=123,
331+
pdp_course_converter_func=cast(Any, 123),
331332
)
332333

333334

0 commit comments

Comments
 (0)