Skip to content

Commit 9d5c25b

Browse files
committed
restore original test case
1 parent b625f08 commit 9d5c25b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/tests/frame/test_to_csv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def test_to_csv_path_is_none(self):
922922
@pytest.mark.parametrize('frame, encoding', [
923923
(DataFrame([[0.123456, 0.234567, 0.567567],
924924
[12.32112, 123123.2, 321321.2]],
925-
index=['A', 'B'], columns=['X', 'Y', 'Z']), 'utf-8'),
925+
index=['A', 'B'], columns=['X', 'Y', 'Z']), None),
926926
(DataFrame([['abc', 'def', 'ghi']], columns=['X', 'Y', 'Z']), 'ascii'),
927927
(DataFrame(5 * [[123, u"你好", u"世界"]],
928928
columns=['X', 'Y', 'Z']), 'gb2312'),
@@ -942,7 +942,7 @@ def test_to_csv_compression(self, frame, encoding, compression):
942942

943943
# explicitly make sure file is compressed
944944
with tm.decompress_file(filename, compression) as fh:
945-
text = fh.read().decode(encoding)
945+
text = fh.read().decode(encoding or 'utf8')
946946
for col in frame.columns:
947947
assert col in text
948948

pandas/tests/series/test_io.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_to_csv_path_is_none(self):
139139

140140
@pytest.mark.parametrize('s, encoding', [
141141
(Series([0.123456, 0.234567, 0.567567], index=['A', 'B', 'C'],
142-
name='X'), 'utf-8'),
142+
name='X'), None),
143143
(Series(['abc', 'def', 'ghi'], name='X'), 'ascii'),
144144
(Series(["123", u"你好", u"世界"], name=u"中文"), 'gb2312'),
145145
(Series(["123", u"Γειά σου", u"Κόσμε"], name=u"Ελληνικά"), 'cp737')
@@ -158,7 +158,7 @@ def test_to_csv_compression(self, s, encoding, compression):
158158

159159
# explicitly ensure file was compressed
160160
with tm.decompress_file(filename, compression) as fh:
161-
text = fh.read().decode(encoding)
161+
text = fh.read().decode(encoding or 'utf8')
162162
assert s.name in text
163163

164164
with tm.decompress_file(filename, compression) as fh:

0 commit comments

Comments
 (0)