Skip to content

Commit 497c4eb

Browse files
authored
TST: test initializing a Series from Index while passing dtype (#27107)
closes #17088
1 parent ad18ea3 commit 497c4eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/series/test_constructors.py

+7
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ def test_constructor_list_like(self):
224224
result = Series(obj, index=[0, 1, 2])
225225
assert_series_equal(result, expected)
226226

227+
@pytest.mark.parametrize('dtype', ['bool', 'int32', 'int64', 'float64'])
228+
def test_constructor_index_dtype(self, dtype):
229+
# GH 17088
230+
231+
s = Series(Index([0, 2, 4]), dtype=dtype)
232+
assert s.dtype == dtype
233+
227234
@pytest.mark.parametrize('input_vals', [
228235
([1, 2]),
229236
(['1', '2']),

0 commit comments

Comments
 (0)