File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed
Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def parse_topkeys(s): # type: (str) -> List[str]
5959def get_diff (source , target ): # type: (str, str) -> str
6060 source_lines = source .splitlines (True )
6161 target_lines = target .splitlines (True )
62- diff = '' .join (difflib .ndiff (source_lines , target_lines ))
62+ diff = '' .join (difflib .unified_diff (source_lines , target_lines ))
6363 return diff
6464
6565
Original file line number Diff line number Diff line change @@ -111,22 +111,24 @@ def test_diffing_output(capsys):
111111 resource_path = get_resource_path ('not_pretty_formatted_json.json' )
112112 expected_retval = 1
113113 expected_out = '''\
114- {
115- - "foo":
116- - "bar",
117- - "alist": [2, 34, 234],
118- + "alist": [
119- + 2,
120- + 34,
121- + 234
122- + ],
123- - "blah": null
124- + "blah": null,
125- ? +
126- + "foo": "bar"
127- }
128-
129- '''
114+ ---
115+ +++
116+ @@ -1,6 +1,9 @@
117+ {
118+ - "foo":
119+ - "bar",
120+ - "alist": [2, 34, 234],
121+ - "blah": null
122+ + "alist": [
123+ + 2,
124+ + 34,
125+ + 234
126+ + ],
127+ + "blah": null,
128+ + "foo": "bar"
129+ }
130+
131+ ''' # noqa: W291
130132 expected_err = 'File {} is not pretty-formatted\n ' .format (resource_path )
131133
132134 actual_retval = main ([resource_path ])
You can’t perform that action at this time.
0 commit comments