@@ -191,31 +191,39 @@ def test_delimiter_with_usecols_and_parse_dates(all_parsers):
191
191
192
192
193
193
@pytest .mark .parametrize ("thousands" , ["_" , None ])
194
- def test_decimal_and_exponential (python_parser_only , numeric_decimal , thousands ):
194
+ def test_decimal_and_exponential (
195
+ request , python_parser_only , numeric_decimal , thousands
196
+ ):
195
197
# GH#31920
196
- decimal_number_check (python_parser_only , numeric_decimal , thousands , None )
198
+ decimal_number_check (request , python_parser_only , numeric_decimal , thousands , None )
197
199
198
200
199
201
@pytest .mark .parametrize ("thousands" , ["_" , None ])
200
202
@pytest .mark .parametrize ("float_precision" , [None , "legacy" , "high" , "round_trip" ])
201
203
def test_1000_sep_decimal_float_precision (
202
- c_parser_only , numeric_decimal , float_precision , thousands
204
+ request , c_parser_only , numeric_decimal , float_precision , thousands
203
205
):
204
206
# test decimal and thousand sep handling in across 'float_precision'
205
207
# parsers
206
- decimal_number_check (c_parser_only , numeric_decimal , thousands , float_precision )
208
+ decimal_number_check (
209
+ request , c_parser_only , numeric_decimal , thousands , float_precision
210
+ )
207
211
text , value = numeric_decimal
208
212
text = " " + text + " "
209
213
if isinstance (value , str ): # the negative cases (parse as text)
210
214
value = " " + value + " "
211
- decimal_number_check (c_parser_only , (text , value ), thousands , float_precision )
215
+ decimal_number_check (
216
+ request , c_parser_only , (text , value ), thousands , float_precision
217
+ )
212
218
213
219
214
- def decimal_number_check (parser , numeric_decimal , thousands , float_precision ):
220
+ def decimal_number_check (request , parser , numeric_decimal , thousands , float_precision ):
215
221
# GH#31920
216
222
value = numeric_decimal [0 ]
217
- if thousands is None and "_" in value :
218
- pytest .skip ("Skip test if no thousands sep is defined and sep is in value" )
223
+ if thousands is None and value in ("1_," , "1_234,56" , "1_234,56e0" ):
224
+ request .node .add_marker (
225
+ pytest .mark .xfail (reason = f"thousands={ thousands } and sep is in { value } " )
226
+ )
219
227
df = parser .read_csv (
220
228
StringIO (value ),
221
229
float_precision = float_precision ,
0 commit comments