Skip to content

Commit 4dc2b69

Browse files
simonjayhawkinsjreback
authored andcommitted
TST/STYLE: concatenate string literals post black reformatting (#27281)
1 parent acccdcc commit 4dc2b69

File tree

101 files changed

+227
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+227
-295
lines changed

pandas/tests/arithmetic/test_numeric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class TestMultiplicationDivision:
469469
pytest.param(
470470
pd.Index,
471471
marks=pytest.mark.xfail(
472-
reason="Index.__div__ always " "raises", raises=TypeError
472+
reason="Index.__div__ always raises", raises=TypeError
473473
),
474474
),
475475
pd.Series,

pandas/tests/arithmetic/test_period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ def test_add_iadd_timedeltalike_annual(self):
960960
def test_pi_add_sub_timedeltalike_freq_mismatch_annual(self, mismatched_freq):
961961
other = mismatched_freq
962962
rng = pd.period_range("2014", "2024", freq="A")
963-
msg = "Input has different freq(=.+)? " "from Period.*?\\(freq=A-DEC\\)"
963+
msg = "Input has different freq(=.+)? from Period.*?\\(freq=A-DEC\\)"
964964
with pytest.raises(IncompatibleFrequency, match=msg):
965965
rng + other
966966
with pytest.raises(IncompatibleFrequency, match=msg):

pandas/tests/arithmetic/test_timedelta64.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,19 @@ def _check(result, expected):
318318
_check(result, expected)
319319

320320
# tz mismatches
321-
msg = "Timestamp subtraction must have the same timezones or no" " timezones"
321+
msg = "Timestamp subtraction must have the same timezones or no timezones"
322322
with pytest.raises(TypeError, match=msg):
323323
dt_tz - ts
324324
msg = "can't subtract offset-naive and offset-aware datetimes"
325325
with pytest.raises(TypeError, match=msg):
326326
dt_tz - dt
327-
msg = "Timestamp subtraction must have the same timezones or no" " timezones"
327+
msg = "Timestamp subtraction must have the same timezones or no timezones"
328328
with pytest.raises(TypeError, match=msg):
329329
dt_tz - ts_tz2
330330
msg = "can't subtract offset-naive and offset-aware datetimes"
331331
with pytest.raises(TypeError, match=msg):
332332
dt - dt_tz
333-
msg = "Timestamp subtraction must have the same timezones or no" " timezones"
333+
msg = "Timestamp subtraction must have the same timezones or no timezones"
334334
with pytest.raises(TypeError, match=msg):
335335
ts - dt_tz
336336
with pytest.raises(TypeError, match=msg):
@@ -1771,7 +1771,7 @@ def test_td64arr_floordiv_int(self, box_with_array):
17711771
result = idx // 1
17721772
tm.assert_equal(result, idx)
17731773

1774-
pattern = "floor_divide cannot use operands|" "Cannot divide int by Timedelta*"
1774+
pattern = "floor_divide cannot use operands|Cannot divide int by Timedelta*"
17751775
with pytest.raises(TypeError, match=pattern):
17761776
1 // idx
17771777

pandas/tests/arrays/categorical/test_operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def test_unordered_different_categories_raises(self):
313313
c1 = Categorical(["a", "b"], categories=["a", "b"], ordered=False)
314314
c2 = Categorical(["a", "c"], categories=["c", "a"], ordered=False)
315315

316-
with pytest.raises(TypeError, match=("Categoricals can " "only be compared")):
316+
with pytest.raises(TypeError, match=("Categoricals can only be compared")):
317317
c1 == c2
318318

319319
def test_compare_different_lengths(self):

pandas/tests/arrays/test_integer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_repr_dtype(dtype, expected):
8888

8989
def test_repr_array():
9090
result = repr(integer_array([1, None, 3]))
91-
expected = "<IntegerArray>\n" "[1, NaN, 3]\n" "Length: 3, dtype: Int64"
91+
expected = "<IntegerArray>\n[1, NaN, 3]\nLength: 3, dtype: Int64"
9292
assert result == expected
9393

9494

pandas/tests/arrays/test_period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def test_repr_small():
259259
arr = period_array(["2000", "2001"], freq="D")
260260
result = str(arr)
261261
expected = (
262-
"<PeriodArray>\n" "['2000-01-01', '2001-01-01']\n" "Length: 2, dtype: period[D]"
262+
"<PeriodArray>\n['2000-01-01', '2001-01-01']\nLength: 2, dtype: period[D]"
263263
)
264264
assert result == expected
265265

pandas/tests/computation/test_eval.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _eval_single_bin(lhs, cmp1, rhs, engine):
9292
return c(lhs, rhs)
9393
except ValueError as e:
9494
if str(e).startswith(
95-
"negative number cannot be " "raised to a fractional power"
95+
"negative number cannot be raised to a fractional power"
9696
):
9797
return np.nan
9898
raise
@@ -362,7 +362,7 @@ def get_expected_pow_result(self, lhs, rhs):
362362
expected = _eval_single_bin(lhs, "**", rhs, self.engine)
363363
except ValueError as e:
364364
if str(e).startswith(
365-
"negative number cannot be " "raised to a fractional power"
365+
"negative number cannot be raised to a fractional power"
366366
):
367367
if self.engine == "python":
368368
pytest.skip(str(e))
@@ -1944,7 +1944,7 @@ def test_empty_string_raises(engine, parser):
19441944

19451945

19461946
def test_more_than_one_expression_raises(engine, parser):
1947-
with pytest.raises(SyntaxError, match=("only a single expression " "is allowed")):
1947+
with pytest.raises(SyntaxError, match=("only a single expression is allowed")):
19481948
pd.eval("1 + 1; 2 + 2", engine=engine, parser=parser)
19491949

19501950

pandas/tests/extension/arrow/bool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def construct_from_string(cls, string):
3333
if string == cls.name:
3434
return cls()
3535
else:
36-
raise TypeError("Cannot construct a '{}' from " "'{}'".format(cls, string))
36+
raise TypeError("Cannot construct a '{}' from '{}'".format(cls, string))
3737

3838
@classmethod
3939
def construct_array_type(cls):

pandas/tests/extension/decimal/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def construct_from_string(cls, string):
4040
if string == cls.name:
4141
return cls()
4242
else:
43-
raise TypeError("Cannot construct a '{}' from " "'{}'".format(cls, string))
43+
raise TypeError("Cannot construct a '{}' from '{}'".format(cls, string))
4444

4545
@property
4646
def _is_numeric(self):
@@ -172,7 +172,7 @@ def _reduce(self, name, skipna=True, **kwargs):
172172
op = getattr(self.data, name)
173173
except AttributeError:
174174
raise NotImplementedError(
175-
"decimal does not support " "the {} operation".format(name)
175+
"decimal does not support the {} operation".format(name)
176176
)
177177
return op(axis=0)
178178

pandas/tests/extension/decimal/test_decimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_series_repr(self, data):
207207
# TODO(extension)
208208
@pytest.mark.xfail(
209209
reason=(
210-
"raising AssertionError as this is not implemented, " "though easy enough to do"
210+
"raising AssertionError as this is not implemented, though easy enough to do"
211211
)
212212
)
213213
def test_series_constructor_coerce_data_to_extension_dtype_raises():

0 commit comments

Comments
 (0)