Skip to content

Commit

Permalink
print lines with diff
Browse files Browse the repository at this point in the history
  • Loading branch information
menon-karthik committed Oct 7, 2024
1 parent 7b1caa7 commit e2d01bb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_dirgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@ def test_directed_graph_generation(setup_files):

generated_dot_file_path = tmp_path / (os.path.splitext(os.path.basename(input_file_path))[0] + "_directed_graph.dot")

#filecmp.clear_cache()
filecmp.clear_cache()
if filecmp.cmp(generated_dot_file_path, expected_dot_file_path, shallow = False) == False:
file1 = open(generated_dot_file_path, 'r')
file2 = open(expected_dot_file_path, 'r')

for line1 in file1:
for line2 in file2:
if line1 != line2:
print("ERROR in following lines:")
print(line1)
print(line2)

filecmp.clear_cache()
assert filecmp.cmp(generated_dot_file_path, expected_dot_file_path, shallow = False), \
f"The generated dot file '{generated_dot_file_path}' does not match the expected dot file '{expected_dot_file_path}'."

Expand Down

0 comments on commit e2d01bb

Please sign in to comment.