|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 |
|
3 |
| -import numpy as np |
4 |
| - |
5 | 3 | import pandas as pd
|
6 |
| -from pandas.core import common as com |
7 | 4 | from pandas import api
|
8 |
| -from pandas.api import types |
9 | 5 | from pandas.util import testing as tm
|
10 | 6 |
|
11 | 7 |
|
@@ -140,80 +136,6 @@ def test_api(self):
|
140 | 136 | self.check(api, self.allowed)
|
141 | 137 |
|
142 | 138 |
|
143 |
| -class TestTypes(Base, tm.TestCase): |
144 |
| - |
145 |
| - allowed = ['is_any_int_dtype', 'is_bool', 'is_bool_dtype', |
146 |
| - 'is_categorical', 'is_categorical_dtype', 'is_complex', |
147 |
| - 'is_complex_dtype', 'is_datetime64_any_dtype', |
148 |
| - 'is_datetime64_dtype', 'is_datetime64_ns_dtype', |
149 |
| - 'is_datetime64tz_dtype', 'is_datetimetz', 'is_dtype_equal', |
150 |
| - 'is_extension_type', 'is_float', 'is_float_dtype', |
151 |
| - 'is_floating_dtype', 'is_int64_dtype', 'is_integer', |
152 |
| - 'is_integer_dtype', 'is_number', 'is_numeric_dtype', |
153 |
| - 'is_object_dtype', 'is_scalar', 'is_sparse', |
154 |
| - 'is_string_dtype', 'is_signed_integer_dtype', |
155 |
| - 'is_timedelta64_dtype', 'is_timedelta64_ns_dtype', |
156 |
| - 'is_unsigned_integer_dtype', 'is_period', |
157 |
| - 'is_period_dtype', 'is_re', 'is_re_compilable', |
158 |
| - 'is_dict_like', 'is_iterator', |
159 |
| - 'is_list_like', 'is_hashable', |
160 |
| - 'is_named_tuple', 'is_sequence', |
161 |
| - 'pandas_dtype'] |
162 |
| - |
163 |
| - def test_types(self): |
164 |
| - |
165 |
| - self.check(types, self.allowed) |
166 |
| - |
167 |
| - def check_deprecation(self, fold, fnew): |
168 |
| - with tm.assert_produces_warning(DeprecationWarning): |
169 |
| - try: |
170 |
| - result = fold('foo') |
171 |
| - expected = fnew('foo') |
172 |
| - self.assertEqual(result, expected) |
173 |
| - except TypeError: |
174 |
| - self.assertRaises(TypeError, |
175 |
| - lambda: fnew('foo')) |
176 |
| - except AttributeError: |
177 |
| - self.assertRaises(AttributeError, |
178 |
| - lambda: fnew('foo')) |
179 |
| - |
180 |
| - def test_deprecation_core_common(self): |
181 |
| - |
182 |
| - # test that we are in fact deprecating |
183 |
| - # the pandas.core.common introspectors |
184 |
| - for t in self.allowed: |
185 |
| - self.check_deprecation(getattr(com, t), getattr(types, t)) |
186 |
| - |
187 |
| - def test_deprecation_core_common_array_equivalent(self): |
188 |
| - |
189 |
| - with tm.assert_produces_warning(DeprecationWarning): |
190 |
| - com.array_equivalent(np.array([1, 2]), np.array([1, 2])) |
191 |
| - |
192 |
| - def test_deprecation_core_common_moved(self): |
193 |
| - |
194 |
| - # these are in pandas.types.common |
195 |
| - l = ['is_datetime_arraylike', |
196 |
| - 'is_datetime_or_timedelta_dtype', |
197 |
| - 'is_datetimelike', |
198 |
| - 'is_datetimelike_v_numeric', |
199 |
| - 'is_datetimelike_v_object', |
200 |
| - 'is_datetimetz', |
201 |
| - 'is_int_or_datetime_dtype', |
202 |
| - 'is_period_arraylike', |
203 |
| - 'is_string_like', |
204 |
| - 'is_string_like_dtype'] |
205 |
| - |
206 |
| - from pandas.types import common as c |
207 |
| - for t in l: |
208 |
| - self.check_deprecation(getattr(com, t), getattr(c, t)) |
209 |
| - |
210 |
| - def test_removed_from_core_common(self): |
211 |
| - |
212 |
| - for t in ['is_null_datelike_scalar', |
213 |
| - 'ensure_float']: |
214 |
| - self.assertRaises(AttributeError, lambda: getattr(com, t)) |
215 |
| - |
216 |
| - |
217 | 139 | class TestDatetools(tm.TestCase):
|
218 | 140 |
|
219 | 141 | def test_deprecation_access_func(self):
|
|
0 commit comments