Skip to content

Commit

Permalink
TST: Add test for sub-char in read_csv (pandas-dev#16977)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and alanbato committed Nov 10, 2017
1 parent f64fd8c commit c0e5b4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pandas/tests/io/parser/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,16 @@ def test_internal_eof_byte_to_file(self):
result = self.read_csv(path)
tm.assert_frame_equal(result, expected)

def test_sub_character(self):
# see gh-16893
dirpath = tm.get_data_path()
filename = os.path.join(dirpath, "sub_char.csv")

expected = DataFrame([[1, 2, 3]], columns=["a", "\x1ab", "c"])
result = self.read_csv(filename)

tm.assert_frame_equal(result, expected)

def test_file_handles(self):
# GH 14418 - don't close user provided file handles

Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/io/parser/data/sub_char.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,"b",c
1,2,3

0 comments on commit c0e5b4f

Please sign in to comment.