Skip to content

Commit

Permalink
replaced deprecated json function with model_dump_json
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Staar <[email protected]>
  • Loading branch information
PeterStaar-IBM committed Aug 26, 2024
1 parent 08364df commit 35bd7b9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_toplevel_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ def test_conversions():

for path in pdf_paths:

print(f"converting {path}")

doc_pred_json = None
doc_true_json = None

try:
# print(f"converting {path}")
try:
doc_pred_json = converter.convert_single(path)
except:
continue
Expand All @@ -114,11 +115,11 @@ def test_conversions():
with open(md_path, "r") as fr:
doc_true_md = "".join(fr.readlines())

doc_ = json.loads(doc_pred_json.model_dump_json())
#doc_ = json.loads(doc_pred_json.model_dump_json())
# print(json.dumps(doc_, indent=2))

assert verify_json(
doc_, doc_true_json
doc_pred_json.model_dump(), doc_true_json
), f"failed json prediction for {path}"

assert verify_md(
Expand Down

0 comments on commit 35bd7b9

Please sign in to comment.