Skip to content

Commit 35cd733

Browse files
committed
cleanups, fix bad filter
1 parent 74d7320 commit 35cd733

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

pandas/tests/indexes/datetimes/test_construction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,9 @@ def test_constructor_with_int_tz(self, klass, box, tz, dtype):
592592
expected = klass([ts])
593593
assert result == expected
594594

595-
@pytest.mark.xfail(reason="TBD", strict=False) # non-strict for tz-naive
596-
@pytest.mark.filterwarnings("ignore:Passing integer:FutureWarning")
595+
# This is the desired future behavior
596+
@pytest.mark.xfail(reason="TBD", strict=False)
597+
@pytest.mark.filterwarnings("ignore:\\n Passing:FutureWarning")
597598
def test_construction_int_rountrip(self, tz_naive_fixture):
598599
# GH 12619
599600
tz = tz_naive_fixture

pandas/tests/indexes/test_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,11 @@ def test_constructor_dtypes_to_timedelta(self, cast_index, vals):
398398
@pytest.mark.parametrize("klass", [pd.Index, pd.DatetimeIndex])
399399
def test_constructor_dtypes_datetime(self, tz_naive_fixture, attr, utc,
400400
klass):
401-
# TODO: update comment
402401
# Test constructing with a datetimetz dtype
403402
# .values produces numpy datetimes, so these are considered naive
404403
# .asi8 produces integers, so these are considered epoch timestamps
404+
# ^the above will be true in a later version. Right now we `.view`
405+
# the i8 values as NS_DTYPE, effectively treating them as wall times.
405406
index = pd.date_range('2011-01-01', periods=5)
406407
arg = getattr(index, attr)
407408
index = index.tz_localize(tz_naive_fixture)
@@ -413,6 +414,8 @@ def test_constructor_dtypes_datetime(self, tz_naive_fixture, attr, utc,
413414
else:
414415
ex_warn = None
415416

417+
# stacklevel is checked elsewhere. We don't do it here since
418+
# Index will have an frame, throwing off the expected.
416419
with tm.assert_produces_warning(ex_warn, check_stacklevel=False):
417420
result = klass(arg, tz=tz_naive_fixture)
418421
tm.assert_index_equal(result, index)

pandas/tests/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ class TestToIterable(object):
10371037
lambda x: list(x.__iter__()),
10381038
], ids=['tolist', 'to_list', 'list', 'iter'])
10391039
@pytest.mark.parametrize('typ', [Series, Index])
1040-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1040+
@pytest.mark.filterwarnings("ignore:\\n Passing:FutureWarning")
10411041
def test_iterable(self, typ, method, dtype, rdtype):
10421042
# gh-10904
10431043
# gh-13258
@@ -1090,7 +1090,7 @@ def test_iterable_items(self, dtype, rdtype):
10901090
('object', (int, long)),
10911091
('category', (int, long))])
10921092
@pytest.mark.parametrize('typ', [Series, Index])
1093-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1093+
@pytest.mark.filterwarnings("ignore:\\n Passing:FutureWarning")
10941094
def test_iterable_map(self, typ, dtype, rdtype):
10951095
# gh-13236
10961096
# coerce iteration to underlying python / pandas types

0 commit comments

Comments
 (0)