From 35bd7b9cffc750d5d4d1c29ebb37c84787d83971 Mon Sep 17 00:00:00 2001 From: Peter Staar Date: Mon, 26 Aug 2024 20:38:42 +0200 Subject: [PATCH] replaced deprecated json function with model_dump_json Signed-off-by: Peter Staar --- tests/test_toplevel_functions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_toplevel_functions.py b/tests/test_toplevel_functions.py index a8eb1bb1..2f945408 100644 --- a/tests/test_toplevel_functions.py +++ b/tests/test_toplevel_functions.py @@ -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 @@ -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(