From 695a96ee2c72c162f39a5a56c7d933408d65cc30 Mon Sep 17 00:00:00 2001 From: David Waroquiers Date: Tue, 12 Mar 2024 17:03:54 +0100 Subject: [PATCH] Adding no branch. --- src/turbomoleio/testing/__init__.py | 2 +- tests/test_testing.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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