File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,15 @@ def test_unparse_prefer_single_line_true():
154154
155155# CLI tests
156156
157+ def _normalize_newlines (text ):
158+ """Normalize line endings for cross-platform comparison."""
159+ return text .replace ('\r \n ' , '\n ' )
160+
161+
157162def test_cli_default_uses_newlines ():
158163 """CLI without --prefer-single-line uses newlines."""
159164 code = 'a = 1\n b = 2\n c = 3'
160- expected = os . linesep . join ([ 'a=1' , 'b=2' , 'c =3'])
165+ expected = 'a=1\n b=2 \n c =3'
161166
162167 with tempfile .NamedTemporaryFile (mode = 'w' , suffix = '.py' , delete = False ) as f :
163168 f .write (code )
@@ -169,7 +174,7 @@ def test_cli_default_uses_newlines():
169174 ], timeout = 30 )
170175
171176 assert result .returncode == 0
172- stdout_text = safe_decode (result .stdout )
177+ stdout_text = _normalize_newlines ( safe_decode (result .stdout ) )
173178 assert stdout_text == expected
174179 finally :
175180 os .unlink (temp_file )
You can’t perform that action at this time.
0 commit comments