TST: Fixturize series/test_dtypes.py (#22967) · pandas-dev/pandas@f1a22ff (original) (raw)

Original file line number Diff line number Diff line change
@@ -24,10 +24,8 @@
24 24 from pandas import compat
25 25 import pandas.util.testing as tm
26 26
27 -from .common import TestData
28 27
29 -
30 -class TestSeriesDtypes(TestData):
28 +class TestSeriesDtypes():
31 29
32 30 def test_dt64_series_astype_object(self):
33 31 dt64ser = Series(date_range('20130101', periods=3))
@@ -56,17 +54,17 @@ def test_asobject_deprecated(self):
56 54 o = s.asobject
57 55 assert isinstance(o, np.ndarray)
58 56
59 -def test_dtype(self):
57 +def test_dtype(self, datetime_series):
60 58
61 -assert self.ts.dtype == np.dtype('float64')
62 -assert self.ts.dtypes == np.dtype('float64')
63 -assert self.ts.ftype == 'float64:dense'
64 -assert self.ts.ftypes == 'float64:dense'
65 -tm.assert_series_equal(self.ts.get_dtype_counts(),
59 +assert datetime_series.dtype == np.dtype('float64')
60 +assert datetime_series.dtypes == np.dtype('float64')
61 +assert datetime_series.ftype == 'float64:dense'
62 +assert datetime_series.ftypes == 'float64:dense'
63 +tm.assert_series_equal(datetime_series.get_dtype_counts(),
66 64 Series(1, ['float64']))
67 65 # GH18243 - Assert .get_ftype_counts is deprecated
68 66 with tm.assert_produces_warning(FutureWarning):
69 -tm.assert_series_equal(self.ts.get_ftype_counts(),
67 +tm.assert_series_equal(datetime_series.get_ftype_counts(),
70 68 Series(1, ['float64:dense']))
71 69
72 70 @pytest.mark.parametrize("value", [np.nan, np.inf])