Skip to content

Commit b4cefc6

Browse files
committed
xfail non working cases
1 parent 36fcb9f commit b4cefc6

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

pandas/tests/frame/methods/test_between_time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def test_between_time_formats(self, request, time_string, frame_or_series):
3535
# GH#11818
3636
request.node.add_marker(
3737
pytest.mark.xfail(
38-
"am" in time_string[0] and locale.getlocale()[0] != "en_US",
39-
reason="Only passes with LC_ALL=en_US.utf8",
38+
"am" in time_string[0] and locale.getlocale()[0] == "zh_CN",
39+
reason="Does not pass with LC_ALL=zh_CN.utf8",
4040
)
4141
)
4242
rng = date_range("1/1/2000", "1/5/2000", freq="5min")

pandas/tests/io/parser/test_parse_dates.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ def test_multi_index_parse_dates(request, all_parsers, index_col):
877877
"""
878878
request.node.add_marker(
879879
pytest.mark.xfail(
880-
locale.getlocale()[0] != "zh_CN" and index_col == [1, 0],
880+
locale.getlocale()[0] == "it_IT" and index_col == ["index2", "index1"],
881881
reason="Only passes with LC_ALL=zh_CN.utf8",
882882
)
883883
)
@@ -1848,7 +1848,7 @@ def test_parse_dates_and_keep_orgin_column(all_parsers):
18481848
tm.assert_frame_equal(result, expected)
18491849

18501850

1851-
def test_dayfirst_warnings():
1851+
def test_dayfirst_warnings(request):
18521852
# GH 12585
18531853
warning_msg_day_first = (
18541854
"Parsing '31/12/2014' in DD/MM/YYYY format. Provide "
@@ -1890,6 +1890,12 @@ def test_dayfirst_warnings():
18901890

18911891
# D. infer_datetime_format=True overrides dayfirst default
18921892
# no warning + correct result
1893+
request.node.add_marker(
1894+
pytest.mark.xfail(
1895+
locale.getlocale()[0] == "zh_CN",
1896+
reason="Does not pass with LC_ALL=zh_CN.utf8",
1897+
)
1898+
)
18931899
res4 = read_csv(
18941900
StringIO(input),
18951901
parse_dates=["date"],

pandas/tests/tools/test_to_datetime.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ def test_to_datetime_format_microsecond(self, cache):
302302
def test_to_datetime_format_time(self, request, cache, value, format, dt):
303303
request.node.add_marker(
304304
pytest.mark.xfail(
305-
"%p" in format and locale.getlocale()[0] != "en_US",
306-
reason="Only passes with LC_ALL=en_US.utf8",
305+
"%p" in format and locale.getlocale()[0] == "zh_CN",
306+
reason="Does not pass with LC_ALL=zh_CN.utf8",
307307
)
308308
)
309309
assert to_datetime(value, format=format, cache=cache) == dt
@@ -1898,7 +1898,7 @@ def test_dayfirst(self, cache):
18981898
tm.assert_index_equal(expected, idx5)
18991899
tm.assert_index_equal(expected, idx6)
19001900

1901-
def test_dayfirst_warnings_valid_input(self):
1901+
def test_dayfirst_warnings_valid_input(self, request):
19021902
# GH 12585
19031903
warning_msg_day_first = (
19041904
"Parsing '31/12/2014' in DD/MM/YYYY format. Provide "
@@ -1930,6 +1930,12 @@ def test_dayfirst_warnings_valid_input(self):
19301930

19311931
# D. infer_datetime_format=True overrides dayfirst default
19321932
# no warning + correct result
1933+
request.node.add_marker(
1934+
pytest.mark.xfail(
1935+
locale.getlocale()[0] == "zh_CN",
1936+
reason="Does not pass with LC_ALL=zh_CN.utf8",
1937+
)
1938+
)
19331939
res4 = to_datetime(arr, infer_datetime_format=True)
19341940
tm.assert_index_equal(expected_consistent, res4)
19351941

@@ -1986,7 +1992,6 @@ def test_to_datetime_dta_tz(self, klass):
19861992

19871993

19881994
class TestGuessDatetimeFormat:
1989-
@td.skip_if_not_us_locale
19901995
@pytest.mark.parametrize(
19911996
"test_array",
19921997
[
@@ -1999,7 +2004,13 @@ class TestGuessDatetimeFormat:
19992004
["2011-12-30 00:00:00.000000", "random_string"],
20002005
],
20012006
)
2002-
def test_guess_datetime_format_for_array(self, test_array):
2007+
def test_guess_datetime_format_for_array(self, request, test_array):
2008+
request.node.add_marker(
2009+
pytest.mark.xfail(
2010+
locale.getlocale()[0] == "zh_CN",
2011+
reason="Does not pass with LC_ALL=zh_CN.utf8",
2012+
)
2013+
)
20032014
expected_format = "%Y-%m-%d %H:%M:%S.%f"
20042015
assert tools._guess_datetime_format_for_array(test_array) == expected_format
20052016

0 commit comments

Comments
 (0)