@@ -191,31 +191,39 @@ def test_delimiter_with_usecols_and_parse_dates(all_parsers):
191191
192192
193193@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+ ):
195197 # 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 )
197199
198200
199201@pytest .mark .parametrize ("thousands" , ["_" , None ])
200202@pytest .mark .parametrize ("float_precision" , [None , "legacy" , "high" , "round_trip" ])
201203def 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
203205):
204206 # test decimal and thousand sep handling in across 'float_precision'
205207 # 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+ )
207211 text , value = numeric_decimal
208212 text = " " + text + " "
209213 if isinstance (value , str ): # the negative cases (parse as text)
210214 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+ )
212218
213219
214- def decimal_number_check (parser , numeric_decimal , thousands , float_precision ):
220+ def decimal_number_check (request , parser , numeric_decimal , thousands , float_precision ):
215221 # GH#31920
216222 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+ )
219227 df = parser .read_csv (
220228 StringIO (value ),
221229 float_precision = float_precision ,
0 commit comments