Skip to content

Commit 0f8bd36

Browse files
committed
Updated tests/io/parser/test_read_fwf.py tests for handling of whitespace in input fields.
Signed-off-by: Ronald Barnes <[email protected]>
1 parent 228ae2c commit 0f8bd36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/io/parser/test_read_fwf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def test_non_space_filler():
122122
201162~~~~502.953953~~~173.237159~~~12468.3
123123
"""
124124
colspecs = [(0, 4), (4, 8), (8, 20), (21, 33), (34, 43)]
125-
result = read_fwf(StringIO(data), colspecs=colspecs, delimiter="~")
125+
result = read_fwf(
126+
StringIO(data), colspecs=colspecs, keep_whitespace=False, whitespace_chars="~"
127+
)
126128

127129
expected = DataFrame(
128130
[
@@ -633,9 +635,7 @@ def test_whitespace_preservation():
633635
fwf_data = """
634636
a bbb
635637
ccdd """
636-
result = read_fwf(
637-
StringIO(fwf_data), widths=[3, 3], header=header, skiprows=[0], delimiter="\n\t"
638-
)
638+
result = read_fwf(StringIO(fwf_data), widths=[3, 3], header=header, skiprows=[0])
639639
expected = read_csv(StringIO(csv_data), header=header)
640640
tm.assert_frame_equal(result, expected)
641641

0 commit comments

Comments
 (0)