Skip to content

Commit d851ec9

Browse files
committed
Incorporate review (jreback)
1 parent 119ceb7 commit d851ec9

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

pandas/conftest.py

+32
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,38 @@ def any_int_dtype(request):
334334
return request.param
335335

336336

337+
FLOAT_DTYPES = [float, "float32", "float64"]
338+
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
339+
STRING_DTYPES = [str, 'str', 'U']
340+
ALL_NUMPY_DTYPES = (ALL_INT_DTYPES + FLOAT_DTYPES
341+
+ STRING_DTYPES + COMPLEX_DTYPES)
342+
343+
344+
@pytest.fixture(params=ALL_NUMPY_DTYPES)
345+
def any_numpy_dtype(request):
346+
"""
347+
Parameterized fixture for any integer dtypes.
348+
349+
* int8
350+
* uint8
351+
* int16
352+
* uint16
353+
* int32
354+
* uint32
355+
* int64
356+
* uint64
357+
* str
358+
* 'str'
359+
* 'U'
360+
* float32
361+
* float64
362+
* complex64
363+
* complex128
364+
"""
365+
366+
return request.param
367+
368+
337369
@pytest.fixture
338370
def mock():
339371
"""

pandas/tests/series/test_analytics.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -962,9 +962,8 @@ def test_unique(self):
962962
('last', Series([False, True, True, False, False, False, False])),
963963
(False, Series([False, True, True, False, True, True, False]))
964964
])
965-
@pytest.mark.parametrize('npdtype', ['int_', 'uint', 'float_', 'unicode_'])
966-
def test_drop_duplicates_non_bool(self, npdtype, keep, expected):
967-
tc = Series([1, 2, 3, 5, 3, 2, 4], dtype=np.dtype(npdtype))
965+
def test_drop_duplicates_non_bool(self, any_numpy_dtype, keep, expected):
966+
tc = Series([1, 2, 3, 5, 3, 2, 4], dtype=np.dtype(any_numpy_dtype))
968967

969968
assert_series_equal(tc.duplicated(keep=keep), expected)
970969
assert_series_equal(tc.drop_duplicates(keep=keep), tc[~expected])

0 commit comments

Comments
 (0)