Skip to content

Commit 2314be8

Browse files
committed
TST: limit printing of xfail cases
1 parent 8185318 commit 2314be8

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

pandas/tests/indexing/test_coercion.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ def test_replace_series(self, how, to_key, from_key):
819819
assert obj.dtype == from_key
820820

821821
if (from_key.startswith('datetime') and to_key.startswith('datetime')):
822-
pytest.xfail("different tz, currently mask_missing "
823-
"raises SystemError")
822+
# tested below
823+
return
824824

825825
if how == 'dict':
826826
replacer = dict(zip(self.rep[from_key], self.rep[to_key]))
@@ -849,5 +849,38 @@ def test_replace_series(self, how, to_key, from_key):
849849

850850
tm.assert_series_equal(result, exp)
851851

852+
# TODO(jreback) commented out to only have a single xfail printed
853+
@pytest.mark.xfail(reason="different tz, "
854+
"currently mask_missing raises SystemError")
855+
# @pytest.mark.parametrize('how', ['dict', 'series'])
856+
# @pytest.mark.parametrize('to_key', [
857+
# 'datetime64[ns]', 'datetime64[ns, UTC]',
858+
# 'datetime64[ns, US/Eastern]'])
859+
# @pytest.mark.parametrize('from_key', [
860+
# 'datetime64[ns]', 'datetime64[ns, UTC]',
861+
# 'datetime64[ns, US/Eastern]'])
862+
# def test_replace_series_datetime_datetime(self, how, to_key, from_key):
863+
def test_replace_series_datetime_datetime(self):
864+
how = 'dict'
865+
to_key = 'datetime64[ns]'
866+
from_key = 'datetime64[ns]'
867+
868+
index = pd.Index([3, 4], name='xxx')
869+
obj = pd.Series(self.rep[from_key], index=index, name='yyy')
870+
assert obj.dtype == from_key
871+
872+
if how == 'dict':
873+
replacer = dict(zip(self.rep[from_key], self.rep[to_key]))
874+
elif how == 'series':
875+
replacer = pd.Series(self.rep[to_key], index=self.rep[from_key])
876+
else:
877+
raise ValueError
878+
879+
result = obj.replace(replacer)
880+
exp = pd.Series(self.rep[to_key], index=index, name='yyy')
881+
assert exp.dtype == to_key
882+
883+
tm.assert_series_equal(result, exp)
884+
852885
def test_replace_series_period(self):
853886
pass

0 commit comments

Comments
 (0)