Skip to content

Commit 2a649b6

Browse files
committed
Incorporate review (jreback)
1 parent 4ca9dee commit 2a649b6

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
@@ -358,6 +358,38 @@ def any_real_dtype(request):
358358
return request.param
359359

360360

361+
FLOAT_DTYPES = [float, "float32", "float64"]
362+
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
363+
STRING_DTYPES = [str, 'str', 'U']
364+
ALL_NUMPY_DTYPES = (ALL_INT_DTYPES + FLOAT_DTYPES
365+
+ STRING_DTYPES + COMPLEX_DTYPES)
366+
367+
368+
@pytest.fixture(params=ALL_NUMPY_DTYPES)
369+
def any_numpy_dtype(request):
370+
"""
371+
Parameterized fixture for any integer dtypes.
372+
373+
* int8
374+
* uint8
375+
* int16
376+
* uint16
377+
* int32
378+
* uint32
379+
* int64
380+
* uint64
381+
* str
382+
* 'str'
383+
* 'U'
384+
* float32
385+
* float64
386+
* complex64
387+
* complex128
388+
"""
389+
390+
return request.param
391+
392+
361393
@pytest.fixture
362394
def mock():
363395
"""

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)