Skip to content

Commit 40bff2f

Browse files
ShaharNavehWillAyd
authored andcommitted
STY: spaces in wrong place (pandas-dev#30767)
1 parent 613df15 commit 40bff2f

13 files changed

+48
-49
lines changed

pandas/tests/indexes/categorical/test_category.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ def test_insert(self):
298298

299299
# invalid
300300
msg = (
301-
"cannot insert an item into a CategoricalIndex that is not"
302-
" already an existing category"
301+
"cannot insert an item into a CategoricalIndex that is not "
302+
"already an existing category"
303303
)
304304
with pytest.raises(TypeError, match=msg):
305305
ci.insert(0, "d")
@@ -528,8 +528,8 @@ def test_get_indexer(self):
528528
tm.assert_almost_equal(r1, np.array([0, 1, 2, -1], dtype=np.intp))
529529

530530
msg = (
531-
"method='pad' and method='backfill' not implemented yet for"
532-
" CategoricalIndex"
531+
"method='pad' and method='backfill' not implemented yet for "
532+
"CategoricalIndex"
533533
)
534534
with pytest.raises(NotImplementedError, match=msg):
535535
idx2.get_indexer(idx1, method="pad")
@@ -673,8 +673,8 @@ def test_equals_categorical(self):
673673
ci1 == Index(["a", "b", "c"])
674674

675675
msg = (
676-
"categorical index comparisons must have the same categories"
677-
" and ordered attributes"
676+
"categorical index comparisons must have the same categories "
677+
"and ordered attributes"
678678
"|"
679679
"Categoricals can only be compared if 'categories' are the same. "
680680
"Categories are different lengths"

pandas/tests/indexes/datetimes/test_constructors.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,15 @@ def test_constructor_coverage(self):
547547

548548
# non-conforming
549549
msg = (
550-
"Inferred frequency None from passed values does not conform"
551-
" to passed frequency D"
550+
"Inferred frequency None from passed values does not conform "
551+
"to passed frequency D"
552552
)
553553
with pytest.raises(ValueError, match=msg):
554554
DatetimeIndex(["2000-01-01", "2000-01-02", "2000-01-04"], freq="D")
555555

556556
msg = (
557-
"Of the four parameters: start, end, periods, and freq, exactly"
558-
" three must be specified"
557+
"Of the four parameters: start, end, periods, and freq, exactly "
558+
"three must be specified"
559559
)
560560
with pytest.raises(ValueError, match=msg):
561561
date_range(start="2011-01-01", freq="b")

pandas/tests/indexes/datetimes/test_tools.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ def test_to_datetime_tz(self, cache):
616616
pd.Timestamp("2013-01-02 14:00:00", tz="US/Eastern"),
617617
]
618618
msg = (
619-
"Tz-aware datetime.datetime cannot be converted to datetime64"
620-
" unless utc=True"
619+
"Tz-aware datetime.datetime cannot be "
620+
"converted to datetime64 unless utc=True"
621621
)
622622
with pytest.raises(ValueError, match=msg):
623623
pd.to_datetime(arr, cache=cache)

pandas/tests/indexes/interval/test_indexing.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -349,17 +349,17 @@ def test_slice_locs_with_interval(self):
349349
with pytest.raises(
350350
KeyError,
351351
match=re.escape(
352-
'"Cannot get left slice bound for non-unique label:'
353-
" Interval(0, 2, closed='right')\""
352+
'"Cannot get left slice bound for non-unique label: '
353+
"Interval(0, 2, closed='right')\""
354354
),
355355
):
356356
index.slice_locs(start=Interval(0, 2), end=Interval(2, 4))
357357

358358
with pytest.raises(
359359
KeyError,
360360
match=re.escape(
361-
'"Cannot get left slice bound for non-unique label:'
362-
" Interval(0, 2, closed='right')\""
361+
'"Cannot get left slice bound for non-unique label: '
362+
"Interval(0, 2, closed='right')\""
363363
),
364364
):
365365
index.slice_locs(start=Interval(0, 2))
@@ -369,17 +369,17 @@ def test_slice_locs_with_interval(self):
369369
with pytest.raises(
370370
KeyError,
371371
match=re.escape(
372-
'"Cannot get right slice bound for non-unique label:'
373-
" Interval(0, 2, closed='right')\""
372+
'"Cannot get right slice bound for non-unique label: '
373+
"Interval(0, 2, closed='right')\""
374374
),
375375
):
376376
index.slice_locs(end=Interval(0, 2))
377377

378378
with pytest.raises(
379379
KeyError,
380380
match=re.escape(
381-
'"Cannot get right slice bound for non-unique label:'
382-
" Interval(0, 2, closed='right')\""
381+
'"Cannot get right slice bound for non-unique label: '
382+
"Interval(0, 2, closed='right')\""
383383
),
384384
):
385385
index.slice_locs(start=Interval(2, 4), end=Interval(0, 2))
@@ -431,8 +431,8 @@ def test_slice_locs_with_ints_and_floats_errors(self, tuples, query):
431431
with pytest.raises(
432432
KeyError,
433433
match=(
434-
"'can only get slices from an IntervalIndex if bounds are"
435-
" non-overlapping and all monotonic increasing or decreasing'"
434+
"'can only get slices from an IntervalIndex if bounds are "
435+
"non-overlapping and all monotonic increasing or decreasing'"
436436
),
437437
):
438438
index.slice_locs(start, stop)

pandas/tests/indexes/interval/test_interval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ def test_missing_values(self, closed):
586586
assert idx.equals(idx2)
587587

588588
msg = (
589-
"missing values must be missing in the same location both left"
590-
" and right sides"
589+
"missing values must be missing in the same location both left "
590+
"and right sides"
591591
)
592592
with pytest.raises(ValueError, match=msg):
593593
IntervalIndex.from_arrays(

pandas/tests/indexes/multi/test_analytics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ def test_numpy_ufuncs(idx, func):
348348
)
349349
def test_numpy_type_funcs(idx, func):
350350
msg = (
351-
f"ufunc '{func.__name__}' not supported for the input types, and the inputs"
352-
" could not be safely coerced to any supported types according to"
353-
" the casting rule ''safe''"
351+
f"ufunc '{func.__name__}' not supported for the input types, and the inputs "
352+
"could not be safely coerced to any supported types according to "
353+
"the casting rule ''safe''"
354354
)
355355
with pytest.raises(TypeError, match=msg):
356356
func(idx)

pandas/tests/indexes/multi/test_constructors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def test_constructor_mismatched_codes_levels(idx):
6565
MultiIndex(levels=levels, codes=codes)
6666

6767
length_error = (
68-
r"On level 0, code max \(3\) >= length of level \(1\)\."
69-
" NOTE: this index is in an inconsistent state"
68+
r"On level 0, code max \(3\) >= length of level \(1\)\. "
69+
"NOTE: this index is in an inconsistent state"
7070
)
7171
label_error = r"Unequal code lengths: \[4, 2\]"
7272
code_value_error = r"On level 0, code value \(-2\) < -1"

pandas/tests/indexes/multi/test_drop.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def test_droplevel_list():
108108
assert dropped.equals(expected)
109109

110110
msg = (
111-
"Cannot remove 3 levels from an index with 3 levels: at least one"
112-
" level must be left"
111+
"Cannot remove 3 levels from an index with 3 levels: "
112+
"at least one level must be left"
113113
)
114114
with pytest.raises(ValueError, match=msg):
115115
index[:2].droplevel(["one", "two", "three"])

pandas/tests/indexes/period/test_period.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ def test_period_index_length(self):
223223
i1 = period_range(start=start, end=end_intv)
224224

225225
msg = (
226-
"Of the three parameters: start, end, and periods, exactly two"
227-
" must be specified"
226+
"Of the three parameters: start, end, and periods, exactly two "
227+
"must be specified"
228228
)
229229
with pytest.raises(ValueError, match=msg):
230230
period_range(start=start)
@@ -427,8 +427,8 @@ def test_contains_nat(self):
427427

428428
def test_periods_number_check(self):
429429
msg = (
430-
"Of the three parameters: start, end, and periods, exactly two"
431-
" must be specified"
430+
"Of the three parameters: start, end, and periods, exactly two "
431+
"must be specified"
432432
)
433433
with pytest.raises(ValueError, match=msg):
434434
period_range("2011-1-1", "2012-1-1", "B")

pandas/tests/indexes/test_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def test_constructor_copy(self, index):
109109
def test_constructor_corner(self):
110110
# corner case
111111
msg = (
112-
r"Index\(\.\.\.\) must be called with a collection of some"
113-
" kind, 0 was passed"
112+
r"Index\(\.\.\.\) must be called with a collection of some "
113+
"kind, 0 was passed"
114114
)
115115
with pytest.raises(TypeError, match=msg):
116116
Index(0)

pandas/tests/indexes/test_numeric.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ def test_constructor_invalid(self):
194194
with pytest.raises(TypeError, match=msg):
195195
Float64Index(0.0)
196196
msg = (
197-
"String dtype not supported, you may need to explicitly cast to"
198-
" a numeric type"
197+
"String dtype not supported, "
198+
"you may need to explicitly cast to a numeric type"
199199
)
200200
with pytest.raises(TypeError, match=msg):
201201
Float64Index(["a", "b", 0.0])
@@ -570,8 +570,8 @@ def test_union_noncomparable(self):
570570

571571
def test_cant_or_shouldnt_cast(self):
572572
msg = (
573-
"String dtype not supported, you may need to explicitly cast to"
574-
" a numeric type"
573+
"String dtype not supported, "
574+
"you may need to explicitly cast to a numeric type"
575575
)
576576
# can't
577577
data = ["foo", "bar", "baz"]
@@ -655,8 +655,8 @@ def test_constructor(self):
655655

656656
# scalar raise Exception
657657
msg = (
658-
r"Int64Index\(\.\.\.\) must be called with a collection of some"
659-
" kind, 5 was passed"
658+
r"Int64Index\(\.\.\.\) must be called with a collection of some "
659+
"kind, 5 was passed"
660660
)
661661
with pytest.raises(TypeError, match=msg):
662662
Int64Index(5)

pandas/tests/indexes/timedeltas/test_constructors.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ def test_constructor_coverage(self):
176176

177177
# non-conforming freq
178178
msg = (
179-
"Inferred frequency None from passed values does not conform to"
180-
" passed frequency D"
179+
"Inferred frequency None from passed values does not conform to "
180+
"passed frequency D"
181181
)
182182
with pytest.raises(ValueError, match=msg):
183183
TimedeltaIndex(["1 days", "2 days", "4 days"], freq="D")
184184

185185
msg = (
186-
"Of the four parameters: start, end, periods, and freq, exactly"
187-
" three must be specified"
186+
"Of the four parameters: start, end, periods, and freq, exactly "
187+
"three must be specified"
188188
)
189189
with pytest.raises(ValueError, match=msg):
190190
timedelta_range(periods=10, freq="D")

pandas/tests/indexes/timedeltas/test_tools.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def test_to_timedelta_invalid(self):
7373

7474
# time not supported ATM
7575
msg = (
76-
"Value must be Timedelta, string, integer, float, timedelta or"
77-
" convertible"
76+
"Value must be Timedelta, string, integer, float, timedelta or convertible"
7877
)
7978
with pytest.raises(ValueError, match=msg):
8079
to_timedelta(time(second=1))

0 commit comments

Comments
 (0)