Skip to content

Commit

Permalink
refactor: use is_platform_windows() (#46973)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt authored May 9, 2022
1 parent 6edb64c commit c40f438
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pandas/tests/io/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import pytest

from pandas.compat import is_platform_windows

import pandas as pd
import pandas._testing as tm

Expand Down Expand Up @@ -325,5 +327,10 @@ def test_tar_gz_to_different_filename():
members = archive.getmembers()
assert len(members) == 1
content = archive.extractfile(members[0]).read().decode("utf8")
content = content.replace("\r\n", "\n") # windows
assert content == "foo,bar\n1,2\n"

if is_platform_windows():
expected = "foo,bar\r\n1,2\r\n"
else:
expected = "foo,bar\n1,2\n"

assert content == expected

0 comments on commit c40f438

Please sign in to comment.