Skip to content

Commit

Permalink
fix: sorting of nested list in printing modified objects
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Dec 3, 2024
1 parent 7cba39a commit 9c40a0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions otterdog/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def _print_modified_dict_internal(
def _print_modified_list_internal(self, current_value, expected_value, prefix: str, color: str) -> None:
from difflib import SequenceMatcher

a = sorted([str(x) for x in current_value])
b = sorted([str(x) for x in expected_value])
a = sorted(current_value)
b = sorted(expected_value)

max_length_a = max((len(str(x)) for x in a), default=0)
max_length_b = max((len(str(x)) for x in b), default=0)
Expand Down
2 changes: 1 addition & 1 deletion tests/operations/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_print_modified_dict(self, test_input, expected: str):

operation.print_modified_dict(test_input, "", False)

assert expected == _strip_string(output.getvalue())
assert _strip_string(output.getvalue()) == expected


def _strip_string(input_string: str) -> str:
Expand Down

0 comments on commit 9c40a0e

Please sign in to comment.