Skip to content

Commit

Permalink
test_workspace.py: try to pretty-print and diff failed assert
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky authored Mar 8, 2024
1 parent 294d83a commit 5f18c85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_workspace.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
from os import chdir
from difflib import unified_diff
from unittest import TestCase, skip, main
from tempfile import NamedTemporaryFile
from ocrd_models.ocrd_page import parseEtree
Expand Down Expand Up @@ -63,4 +64,6 @@ def test_api(self):
},
)
del tar_img_path_elem.attrib["imageFilename"]
assert ET.tostring(target_tree) == ET.tostring(result_tree)
assert ET.tostring(target_tree) == ET.tostring(result_tree), unified_diff(
ET.tostring(target_tree, pretty_print=True, encoding='UTF-8'),
ET.tostring(result_tree, pretty_print=True, encoding='UTF-8'))

0 comments on commit 5f18c85

Please sign in to comment.