Skip to content

Commit

Permalink
chore: Remove deprecated method
Browse files Browse the repository at this point in the history
The `parse_file` method is deprecated; load the data from file, then if your data is JSON use `model_validate_json`, otherwise `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/
  • Loading branch information
alexpovel committed Jan 1, 2024
1 parent ce4407c commit f8c5ab3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/visualization/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from datetime import date
from pathlib import Path
from typing import Optional
Expand Down Expand Up @@ -381,7 +382,13 @@ def test_rejects_unknown_configs(model, expectation) -> None:
)
def test_expected_outputs(path: Path) -> None:
"""For each resume, compare with expected rendered output in sibling directory."""
rendered_resume = Template.from_model_config(ResumeSchema.parse_file(path)).render()

with open(path, encoding="utf8") as f:
json_data = json.load(f)

rendered_resume = Template.from_model_config(
ResumeSchema.model_validate(json_data)
).render()

while path.suffix:
path = path.with_suffix("")
Expand Down

0 comments on commit f8c5ab3

Please sign in to comment.