Skip to content

Commit a5d5b82

Browse files
committed
test: parametrize test for test_readonly_cut
1 parent 88903b9 commit a5d5b82

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/reshape/test_tile.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -512,17 +512,20 @@ def f():
512512
tm.assert_numpy_array_equal(
513513
mask, np.array([False, True, True, True, True]))
514514

515-
def test_cut_read_only(self):
515+
@pytest.mark.parametrize("array_1_writeable,array_2_writeable",[
516+
(True, True), (True, False), (False, False)])
517+
def test_cut_read_only(self, array_1_writeable, array_2_writeable):
516518
# issue 18773
517-
readonly = np.arange(0, 100, 10)
518-
readonly.flags.writeable = False
519+
array_1 = np.arange(0, 100, 10)
520+
array_1.flags.writeable = array_1_writeable
519521

520-
mutable = np.arange(0, 100, 10)
522+
array_2 = np.arange(0, 100, 10)
523+
array_2.flags.writeable = array_2_writeable
521524

522525
hundred_elements = np.arange(100)
523-
tm.assert_categorical_equal(cut(hundred_elements, readonly),
524-
cut(hundred_elements, mutable))
525526

527+
tm.assert_categorical_equal(cut(hundred_elements, array_1),
528+
cut(hundred_elements, array_2))
526529

527530
def curpath():
528531
pth, _ = os.path.split(os.path.abspath(__file__))

0 commit comments

Comments
 (0)