Skip to content

Commit 83cd9ae

Browse files
committed
fixups
1 parent 5a1b8ee commit 83cd9ae

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

pandas/tests/extension/base/dtype.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ def test_check_dtype(self, data):
6969
expected = pd.Series([True, True, False, False],
7070
index=list('ABCD'))
7171

72-
with warnings.catch_warnings():
7372
# XXX: This should probably be *fixed* not ignored.
7473
# See libops.scalar_compare
75-
warnings.simplefilter("ignore", DeprecationWarning)
76-
result = df.dtypes == str(dtype)
74+
# warnings.simplefilter("ignore", DeprecationWarning)
75+
result = df.dtypes == str(dtype)
7776
self.assert_series_equal(result, expected)
7877

7978
expected = pd.Series([True, True, False, False],

pandas/tests/indexes/datetimes/test_tools.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1589,15 +1589,18 @@ def units_from_epochs():
15891589
return list(range(5))
15901590

15911591

1592-
@pytest.fixture(params=['timestamp', 'pydatetime', 'datetime64'])
1592+
@pytest.fixture(params=['timestamp', 'pydatetime', 'datetime64', 'str_1960'])
15931593
def epochs(epoch_1960, request):
1594-
assert request.param in {'timestamp', 'pydatetime', 'datetime64'}
1594+
assert request.param in {'timestamp', 'pydatetime', 'datetime64',
1595+
"str_1960"}
15951596
if request.param == 'timestamp':
15961597
return epoch_1960
15971598
elif request.param == 'pydatetime':
15981599
return epoch_1960.to_pydatetime()
1599-
else:
1600+
elif request.param == "datetime64":
16001601
return epoch_1960.to_datetime64()
1602+
else:
1603+
return str(epoch_1960)
16011604

16021605

16031606
@pytest.fixture

pandas/tests/test_downstream.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_oo_optimizable():
6363

6464
@tm.network
6565
# Cython import warning
66-
@pytest.mark.filterwarnings("ignore::ImportWarning")
66+
@pytest.mark.filterwarnings("ignore:can't:ImportWarning")
6767
def test_statsmodels():
6868

6969
statsmodels = import_module('statsmodels') # noqa
@@ -74,7 +74,7 @@ def test_statsmodels():
7474

7575

7676
# Cython import warning
77-
@pytest.mark.filterwarnings("ignore::ImportWarning")
77+
@pytest.mark.filterwarnings("ignore:can't:ImportWarning")
7878
def test_scikit_learn(df):
7979

8080
sklearn = import_module('sklearn') # noqa
@@ -110,8 +110,10 @@ def test_pandas_datareader():
110110
'F', 'quandl', '2017-01-01', '2017-02-01')
111111

112112

113-
# importing from pandas, Cython mport warning
114-
@pytest.mark.filterwarnings("ignore")
113+
# importing from pandas, Cython import warning
114+
@pytest.mark.filterwarnings("ignore:The 'warn':DeprecationWarning")
115+
@pytest.mark.filterwarnings("ignore:pandas.util:DeprecationWarning")
116+
@pytest.mark.filterwarnings("ignore:can't resolve:ImportWarning")
115117
def test_geopandas():
116118

117119
geopandas = import_module('geopandas') # noqa
@@ -120,7 +122,7 @@ def test_geopandas():
120122

121123

122124
# Cython import warning
123-
@pytest.mark.filterwarnings("ignore")
125+
@pytest.mark.filterwarnings("ignore:can't resolve:ImportWarning")
124126
def test_pyarrow(df):
125127

126128
pyarrow = import_module('pyarrow') # noqa

0 commit comments

Comments
 (0)