Skip to content

Commit c7b2566

Browse files
committed
32-bit issues in test/indexing/test_loc.py
1 parent 1037f19 commit c7b2566

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pandas/tests/indexing/test_loc.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def test_loc_to_fail2(self):
454454
s.loc[-1]
455455

456456
msg = (
457-
fr"\"None of \[NumericIndex\(\[-1, -2\], dtype='{np.intp().dtype}'\)\] are "
457+
rf"\"None of \[NumericIndex\(\[-1, -2\], dtype='{np.intp().dtype}'\)\] are "
458458
r"in the \[index\]\""
459459
)
460460
with pytest.raises(KeyError, match=msg):
@@ -470,7 +470,7 @@ def test_loc_to_fail2(self):
470470

471471
s["a"] = 2
472472
msg = (
473-
fr"\"None of \[NumericIndex\(\[-2\], dtype='{np.intp().dtype}'\)\] are "
473+
rf"\"None of \[NumericIndex\(\[-2\], dtype='{np.intp().dtype}'\)\] are "
474474
r"in the \[index\]\""
475475
)
476476
with pytest.raises(KeyError, match=msg):
@@ -487,7 +487,7 @@ def test_loc_to_fail3(self):
487487
df = DataFrame([["a"], ["b"]], index=[1, 2], columns=["value"])
488488

489489
msg = (
490-
fr"\"None of \[NumericIndex\(\[3\], dtype='{np.intp().dtype}'\)\] are "
490+
rf"\"None of \[NumericIndex\(\[3\], dtype='{np.intp().dtype}'\)\] are "
491491
r"in the \[index\]\""
492492
)
493493
with pytest.raises(KeyError, match=msg):
@@ -504,12 +504,11 @@ def test_loc_getitem_list_with_fail(self):
504504

505505
s.loc[[2]]
506506

507-
with pytest.raises(
508-
KeyError,
509-
match=re.escape(
510-
f"\"None of [NumericIndex([3], dtype='{np.intp().dtype}')] are in the [index]\""
511-
),
512-
):
507+
msg = (
508+
f"\"None of [NumericIndex([3], dtype='{np.intp().dtype}')] "
509+
f"are in the [index]\""
510+
)
511+
with pytest.raises(KeyError, match=re.escape(msg)):
513512
s.loc[[3]]
514513

515514
# a non-match and a match
@@ -1213,7 +1212,7 @@ def test_loc_setitem_empty_append_raises(self):
12131212
df = DataFrame(columns=["x", "y"])
12141213
df.index = df.index.astype(np.int64)
12151214
msg = (
1216-
fr"None of \[NumericIndex\(\[0, 1\], dtype='{np.intp().dtype}'\)\] "
1215+
rf"None of \[NumericIndex\(\[0, 1\], dtype='{np.intp().dtype}'\)\] "
12171216
r"are in the \[index\]"
12181217
)
12191218
with pytest.raises(KeyError, match=msg):

pandas/tests/indexing/test_partial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ def test_series_partial_set(self):
403403

404404
# raises as nothing is in the index
405405
msg = (
406-
fr"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}'\)\] are "
407-
r"in the \[index\]\""
406+
rf"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}'\)\] "
407+
r"are in the \[index\]\""
408408
)
409409
with pytest.raises(KeyError, match=msg):
410410
ser.loc[[3, 3, 3]]
@@ -484,7 +484,7 @@ def test_series_partial_set_with_name(self):
484484

485485
# raises as nothing is in the index
486486
msg = (
487-
fr"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}', "
487+
rf"\"None of \[NumericIndex\(\[3, 3, 3\], dtype='{np.intp().dtype}', "
488488
r"name='idx'\)\] are in the \[index\]\""
489489
)
490490
with pytest.raises(KeyError, match=msg):

0 commit comments

Comments
 (0)