Skip to content

Commit

Permalink
TST: Fixturize series/test_dtypes.py (#22967)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjali2019 authored and jreback committed Oct 4, 2018
1 parent abf68fd commit f1a22ff
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pandas/tests/series/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
from pandas import compat
import pandas.util.testing as tm

from .common import TestData


class TestSeriesDtypes(TestData):
class TestSeriesDtypes():

def test_dt64_series_astype_object(self):
dt64ser = Series(date_range('20130101', periods=3))
Expand Down Expand Up @@ -56,17 +54,17 @@ def test_asobject_deprecated(self):
o = s.asobject
assert isinstance(o, np.ndarray)

def test_dtype(self):
def test_dtype(self, datetime_series):

assert self.ts.dtype == np.dtype('float64')
assert self.ts.dtypes == np.dtype('float64')
assert self.ts.ftype == 'float64:dense'
assert self.ts.ftypes == 'float64:dense'
tm.assert_series_equal(self.ts.get_dtype_counts(),
assert datetime_series.dtype == np.dtype('float64')
assert datetime_series.dtypes == np.dtype('float64')
assert datetime_series.ftype == 'float64:dense'
assert datetime_series.ftypes == 'float64:dense'
tm.assert_series_equal(datetime_series.get_dtype_counts(),
Series(1, ['float64']))
# GH18243 - Assert .get_ftype_counts is deprecated
with tm.assert_produces_warning(FutureWarning):
tm.assert_series_equal(self.ts.get_ftype_counts(),
tm.assert_series_equal(datetime_series.get_ftype_counts(),
Series(1, ['float64:dense']))

@pytest.mark.parametrize("value", [np.nan, np.inf])
Expand Down

0 comments on commit f1a22ff

Please sign in to comment.