Skip to content

Commit 660803c

Browse files
committed
moved test to tests/arrays/string_/test_string.py file
1 parent 7b312ae commit 660803c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pandas/tests/arrays/string_/test_string.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,3 +758,9 @@ def test_tolist(dtype):
758758
result = arr.tolist()
759759
expected = vals
760760
tm.assert_equal(result, expected)
761+
762+
763+
def test_string_array_view_type_error():
764+
arr = pd.array(["a", "b", "c"], dtype="string")
765+
with pytest.raises(TypeError, match="Cannot change data-type for string array."):
766+
arr.view("i8")

pandas/tests/indexes/test_base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,13 +1351,6 @@ def test_index_round(self, decimals, expected_results):
13511351

13521352
tm.assert_index_equal(result, expected)
13531353

1354-
def test_string_array_view_type_error(self):
1355-
arr = pd.array(["a", "b", "c"], dtype="string")
1356-
with pytest.raises(
1357-
TypeError, match="Cannot change data-type for string array."
1358-
):
1359-
arr.view("i8")
1360-
13611354

13621355
class TestMixedIntIndex:
13631356
# Mostly the tests from common.py for which the results differ

0 commit comments

Comments
 (0)