From d1eb530d2322e29b81a626bff311b767530005ad Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 15 Aug 2024 20:17:06 -0500 Subject: [PATCH] Cleaning up file checks --- test/test_examples.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_examples.py b/test/test_examples.py index 1dd5b5a..576b1de 100644 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -43,5 +43,6 @@ def test_example(example, request): output = example_name(example) to_cubit_journal(model.geometry, world=world, filename=output) - if not filecmp.cmp(output, request.path.parent / Path('gold') / output): - print(''.join(difflib.unified_diff(open(output).readlines(), request.path.parent / open(Path('gold') / output).readlines()))) + gold_file = request.path.parent / Path('gold') / Path(output) + if not filecmp.cmp(output, gold_file): + print(''.join(difflib.unified_diff(open(output).readlines(), open(gold_file).readlines())))