@@ -2211,6 +2211,21 @@ def test_read_table_delim_whitespace_default_sep(all_parsers):
2211
2211
tm .assert_frame_equal (result , expected )
2212
2212
2213
2213
2214
+ def test_read_csv_delim_whitespace_non_default_sep (all_parsers ):
2215
+ # GH: 35958
2216
+ f = StringIO ("a b c\n 1 -2 -3\n 4 5 6" )
2217
+ parser = all_parsers
2218
+ msg = (
2219
+ "Specified a delimiter with both sep and "
2220
+ "delim_whitespace=True; you can only specify one."
2221
+ )
2222
+ with pytest .raises (ValueError , match = msg ):
2223
+ parser .read_csv (f , delim_whitespace = True , sep = "\t " )
2224
+
2225
+ with pytest .raises (ValueError , match = msg ):
2226
+ parser .read_csv (f , delim_whitespace = True , delimiter = "\t " )
2227
+
2228
+
2214
2229
def test_read_table_delim_whitespace_non_default_sep (all_parsers ):
2215
2230
# GH: 35958
2216
2231
f = StringIO ("a b c\n 1 -2 -3\n 4 5 6" )
@@ -2221,3 +2236,36 @@ def test_read_table_delim_whitespace_non_default_sep(all_parsers):
2221
2236
)
2222
2237
with pytest .raises (ValueError , match = msg ):
2223
2238
parser .read_table (f , delim_whitespace = True , sep = "," )
2239
+
2240
+ with pytest .raises (ValueError , match = msg ):
2241
+ parser .read_table (f , delim_whitespace = True , delimiter = "," )
2242
+
2243
+
2244
+ def test_read_csv_delim_whitespace_explicit_default_sep (all_parsers ):
2245
+ # GH: 35958
2246
+ f = StringIO ("a b c\n 1 -2 -3\n 4 5 6" )
2247
+ parser = all_parsers
2248
+ msg = (
2249
+ "Specified a delimiter with both sep and "
2250
+ "delim_whitespace=True; you can only specify one."
2251
+ )
2252
+ with pytest .raises (ValueError , match = msg ):
2253
+ parser .read_csv (f , delim_whitespace = True , sep = "," )
2254
+
2255
+ with pytest .raises (ValueError , match = msg ):
2256
+ parser .read_csv (f , delim_whitespace = True , delimiter = "," )
2257
+
2258
+
2259
+ def test_read_table_delim_whitespace_explicit_default_sep (all_parsers ):
2260
+ # GH: 35958
2261
+ f = StringIO ("a b c\n 1 -2 -3\n 4 5 6" )
2262
+ parser = all_parsers
2263
+ msg = (
2264
+ "Specified a delimiter with both sep and "
2265
+ "delim_whitespace=True; you can only specify one."
2266
+ )
2267
+ with pytest .raises (ValueError , match = msg ):
2268
+ parser .read_table (f , delim_whitespace = True , sep = "\t " )
2269
+
2270
+ with pytest .raises (ValueError , match = msg ):
2271
+ parser .read_table (f , delim_whitespace = True , delimiter = "\t " )
0 commit comments