Skip to content

Commit 8ca4e76

Browse files
Skn0ttyehoshuadimarsky
authored andcommitted
refactor: use is_platform_windows() (pandas-dev#46973)
1 parent 58bba9b commit 8ca4e76

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pandas/tests/io/test_compression.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import pytest
1313

14+
from pandas.compat import is_platform_windows
15+
1416
import pandas as pd
1517
import pandas._testing as tm
1618

@@ -325,5 +327,10 @@ def test_tar_gz_to_different_filename():
325327
members = archive.getmembers()
326328
assert len(members) == 1
327329
content = archive.extractfile(members[0]).read().decode("utf8")
328-
content = content.replace("\r\n", "\n") # windows
329-
assert content == "foo,bar\n1,2\n"
330+
331+
if is_platform_windows():
332+
expected = "foo,bar\r\n1,2\r\n"
333+
else:
334+
expected = "foo,bar\n1,2\n"
335+
336+
assert content == expected

0 commit comments

Comments
 (0)