Skip to content

Commit af2f311

Browse files
PEP :eyeroll:
1 parent e261b24 commit af2f311

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

pandas/tests/extension/base/setitem.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pandas.errors import MismatchedIndexValueError
55

66
import pandas as pd
7-
from pandas import _testing as tm
7+
import pandas._testing as tm
88

99
from .base import BaseExtensionTests
1010

@@ -247,8 +247,9 @@ def test_setitem_expand_with_extension(self, data):
247247
def test_setitem_frame_invalid_length(self, data):
248248
df = pd.DataFrame({"A": [1] * len(data)})
249249
xpr = (
250-
f"Length of values \({len(data[:5])}\) "
251-
f"does not match length of index \({len(df)}\)")
250+
rf"Length of values \({len(data[:5])}\) "
251+
rf"does not match length of index \({len(df)}\)"
252+
)
252253
with pytest.raises(MismatchedIndexValueError, match=xpr):
253254
df["B"] = data[:5]
254255

pandas/tests/frame/indexing/test_indexing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
MultiIndex,
1818
Series,
1919
Timestamp,
20-
_testing as tm,
2120
date_range,
2221
isna,
2322
notna,
2423
)
25-
from pandas.core import common as com
24+
import pandas._testing as tm
25+
import pandas.core.common as com
2626
from pandas.core.indexing import IndexingError
2727

2828
from pandas.tseries.offsets import BDay
@@ -163,8 +163,9 @@ def test_setitem_list(self, float_frame):
163163
data[["A"]] = float_frame[["A", "B"]]
164164
newcolumndata = range(len(data.index) - 1)
165165
msg = (
166-
f"Length of values \({len(newcolumndata)}\) "
167-
f"does not match length of index \({len(data)}\)")
166+
rf"Length of values \({len(newcolumndata)}\) "
167+
rf"does not match length of index \({len(data)}\)"
168+
)
168169
with pytest.raises(MismatchedIndexValueError, match=msg):
169170
data["A"] = newcolumndata
170171

pandas/tests/frame/indexing/test_setitem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def test_setitem_wrong_length_categorical_dtype_raises(self):
120120
df = DataFrame(range(10), columns=["bar"])
121121

122122
msg = (
123-
f"Length of values \({len(cat)}\) "
124-
f"does not match length of index \({len(df)}\)"
123+
rf"Length of values \({len(cat)}\) "
124+
rf"does not match length of index \({len(df)}\)"
125125
)
126126
with pytest.raises(MismatchedIndexValueError, match=msg):
127127
df["foo"] = cat

0 commit comments

Comments
 (0)