diff --git a/tests/__init__.py b/tests/__init__.py index ae3405e1..b2c04124 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -3,6 +3,7 @@ from pathlib import Path import re from typing import Dict, List +from difflib import context_diff import pytest @@ -68,6 +69,13 @@ def check_reference_directory( del test_lines[line_index], reference_lines[line_index] cwd = Path.cwd() - assert '\n'.join(test_lines) == '\n'.join( - reference_lines - ), f'"{os.path.relpath(test_filename, cwd)}" != "{os.path.relpath(reference_filename, cwd)}"' + + assert '\n'.join(test_lines) == '\n'.join(reference_lines), ''.join( + context_diff( + test_lines, + reference_lines, + fromfile=str(test_filename), + tofile=str(reference_filename), + lineterm='', + ) + )