Skip to content

Commit c06442b

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

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

pandas/conftest.py

+32-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ def complex_dtype(request):
289289
UNSIGNED_INT_DTYPES = ["uint8", "uint16", "uint32", "uint64"]
290290
SIGNED_INT_DTYPES = [int, "int8", "int16", "int32", "int64"]
291291
ALL_INT_DTYPES = UNSIGNED_INT_DTYPES + SIGNED_INT_DTYPES
292-
ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
293292

294293

295294
@pytest.fixture(params=SIGNED_INT_DTYPES)
@@ -338,6 +337,13 @@ def any_int_dtype(request):
338337
return request.param
339338

340339

340+
FLOAT_DTYPES = [float, "float32", "float64"]
341+
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
342+
STRING_DTYPES = [str, 'str', 'U']
343+
ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
344+
ALL_NUMPY_DTYPES = ALL_REAL_DTYPES + STRING_DTYPES + COMPLEX_DTYPES
345+
346+
341347
@pytest.fixture(params=ALL_REAL_DTYPES)
342348
def any_real_dtype(request):
343349
"""
@@ -358,6 +364,31 @@ def any_real_dtype(request):
358364
return request.param
359365

360366

367+
@pytest.fixture(params=ALL_NUMPY_DTYPES)
368+
def any_numpy_dtype(request):
369+
"""
370+
Parameterized fixture for any integer dtypes.
371+
372+
* int8
373+
* uint8
374+
* int16
375+
* uint16
376+
* int32
377+
* uint32
378+
* int64
379+
* uint64
380+
* float32
381+
* float64
382+
* complex64
383+
* complex128
384+
* str
385+
* 'str'
386+
* 'U'
387+
"""
388+
389+
return request.param
390+
391+
361392
@pytest.fixture
362393
def mock():
363394
"""

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)