Skip to content

TST: Fixturize series/test_dtypes.py #22967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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