diff --git a/src/turbomoleio/testing/__init__.py b/src/turbomoleio/testing/__init__.py index ff1b70c..4f61ea9 100644 --- a/src/turbomoleio/testing/__init__.py +++ b/src/turbomoleio/testing/__init__.py @@ -614,7 +614,7 @@ def compare_differences(actual, desired, rtol=1e-7, atol=0, current_level=None): ) return differences except ValueError as err: - if "setting an array element with a sequence." in str(err): + if "setting an array element with a sequence." in str(err): # pragma: no branch pass if isinstance(desired, (list, tuple)): diff --git a/tests/test_testing.py b/tests/test_testing.py index 1822b76..b584f27 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -447,6 +447,12 @@ def test_compare_differences(self): assert len(diffs) == 1 assert diffs[0][1].startswith(f">>>{STRINGS_DIFFER}<<<") + diffs = compare_differences("samestring", "samestring") + assert len(diffs) == 0 + diffs = compare_differences([1, 2, 3], [1, 2, [3, 4]]) assert len(diffs) == 1 assert diffs[0][1].startswith(f">>>{ARRAYS_DIFFER}<<<") + + diffs = compare_differences([1, 2, [4, 5]], [1, 2, [4, 5]]) + assert len(diffs) == 0