Skip to content

STY: spaces in wrong place #30767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pandas/tests/indexes/categorical/test_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ def test_insert(self):

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

msg = (
"method='pad' and method='backfill' not implemented yet for"
" CategoricalIndex"
"method='pad' and method='backfill' not implemented yet for "
"CategoricalIndex"
)
with pytest.raises(NotImplementedError, match=msg):
idx2.get_indexer(idx1, method="pad")
Expand Down Expand Up @@ -673,8 +673,8 @@ def test_equals_categorical(self):
ci1 == Index(["a", "b", "c"])

msg = (
"categorical index comparisons must have the same categories"
" and ordered attributes"
"categorical index comparisons must have the same categories "
"and ordered attributes"
"|"
"Categoricals can only be compared if 'categories' are the same. "
"Categories are different lengths"
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/indexes/datetimes/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ def test_constructor_coverage(self):

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

msg = (
"Of the four parameters: start, end, periods, and freq, exactly"
" three must be specified"
"Of the four parameters: start, end, periods, and freq, exactly "
"three must be specified"
)
with pytest.raises(ValueError, match=msg):
date_range(start="2011-01-01", freq="b")
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/datetimes/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ def test_to_datetime_tz(self, cache):
pd.Timestamp("2013-01-02 14:00:00", tz="US/Eastern"),
]
msg = (
"Tz-aware datetime.datetime cannot be converted to datetime64"
" unless utc=True"
"Tz-aware datetime.datetime cannot be "
"converted to datetime64 unless utc=True"
)
with pytest.raises(ValueError, match=msg):
pd.to_datetime(arr, cache=cache)
Expand Down
20 changes: 10 additions & 10 deletions pandas/tests/indexes/interval/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ def test_slice_locs_with_interval(self):
with pytest.raises(
KeyError,
match=re.escape(
'"Cannot get left slice bound for non-unique label:'
" Interval(0, 2, closed='right')\""
'"Cannot get left slice bound for non-unique label: '
"Interval(0, 2, closed='right')\""
),
):
index.slice_locs(start=Interval(0, 2), end=Interval(2, 4))

with pytest.raises(
KeyError,
match=re.escape(
'"Cannot get left slice bound for non-unique label:'
" Interval(0, 2, closed='right')\""
'"Cannot get left slice bound for non-unique label: '
"Interval(0, 2, closed='right')\""
),
):
index.slice_locs(start=Interval(0, 2))
Expand All @@ -369,17 +369,17 @@ def test_slice_locs_with_interval(self):
with pytest.raises(
KeyError,
match=re.escape(
'"Cannot get right slice bound for non-unique label:'
" Interval(0, 2, closed='right')\""
'"Cannot get right slice bound for non-unique label: '
"Interval(0, 2, closed='right')\""
),
):
index.slice_locs(end=Interval(0, 2))

with pytest.raises(
KeyError,
match=re.escape(
'"Cannot get right slice bound for non-unique label:'
" Interval(0, 2, closed='right')\""
'"Cannot get right slice bound for non-unique label: '
"Interval(0, 2, closed='right')\""
),
):
index.slice_locs(start=Interval(2, 4), end=Interval(0, 2))
Expand Down Expand Up @@ -431,8 +431,8 @@ def test_slice_locs_with_ints_and_floats_errors(self, tuples, query):
with pytest.raises(
KeyError,
match=(
"'can only get slices from an IntervalIndex if bounds are"
" non-overlapping and all monotonic increasing or decreasing'"
"'can only get slices from an IntervalIndex if bounds are "
"non-overlapping and all monotonic increasing or decreasing'"
),
):
index.slice_locs(start, stop)
4 changes: 2 additions & 2 deletions pandas/tests/indexes/interval/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ def test_missing_values(self, closed):
assert idx.equals(idx2)

msg = (
"missing values must be missing in the same location both left"
" and right sides"
"missing values must be missing in the same location both left "
"and right sides"
)
with pytest.raises(ValueError, match=msg):
IntervalIndex.from_arrays(
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/indexes/multi/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ def test_numpy_ufuncs(idx, func):
)
def test_numpy_type_funcs(idx, func):
msg = (
f"ufunc '{func.__name__}' not supported for the input types, and the inputs"
" could not be safely coerced to any supported types according to"
" the casting rule ''safe''"
f"ufunc '{func.__name__}' not supported for the input types, and the inputs "
"could not be safely coerced to any supported types according to "
"the casting rule ''safe''"
)
with pytest.raises(TypeError, match=msg):
func(idx)
4 changes: 2 additions & 2 deletions pandas/tests/indexes/multi/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def test_constructor_mismatched_codes_levels(idx):
MultiIndex(levels=levels, codes=codes)

length_error = (
r"On level 0, code max \(3\) >= length of level \(1\)\."
" NOTE: this index is in an inconsistent state"
r"On level 0, code max \(3\) >= length of level \(1\)\. "
"NOTE: this index is in an inconsistent state"
)
label_error = r"Unequal code lengths: \[4, 2\]"
code_value_error = r"On level 0, code value \(-2\) < -1"
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/multi/test_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def test_droplevel_list():
assert dropped.equals(expected)

msg = (
"Cannot remove 3 levels from an index with 3 levels: at least one"
" level must be left"
"Cannot remove 3 levels from an index with 3 levels: "
"at least one level must be left"
)
with pytest.raises(ValueError, match=msg):
index[:2].droplevel(["one", "two", "three"])
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/indexes/period/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ def test_period_index_length(self):
i1 = period_range(start=start, end=end_intv)

msg = (
"Of the three parameters: start, end, and periods, exactly two"
" must be specified"
"Of the three parameters: start, end, and periods, exactly two "
"must be specified"
)
with pytest.raises(ValueError, match=msg):
period_range(start=start)
Expand Down Expand Up @@ -427,8 +427,8 @@ def test_contains_nat(self):

def test_periods_number_check(self):
msg = (
"Of the three parameters: start, end, and periods, exactly two"
" must be specified"
"Of the three parameters: start, end, and periods, exactly two "
"must be specified"
)
with pytest.raises(ValueError, match=msg):
period_range("2011-1-1", "2012-1-1", "B")
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def test_constructor_copy(self, index):
def test_constructor_corner(self):
# corner case
msg = (
r"Index\(\.\.\.\) must be called with a collection of some"
" kind, 0 was passed"
r"Index\(\.\.\.\) must be called with a collection of some "
"kind, 0 was passed"
)
with pytest.raises(TypeError, match=msg):
Index(0)
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/indexes/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def test_constructor_invalid(self):
with pytest.raises(TypeError, match=msg):
Float64Index(0.0)
msg = (
"String dtype not supported, you may need to explicitly cast to"
" a numeric type"
"String dtype not supported, "
"you may need to explicitly cast to a numeric type"
)
with pytest.raises(TypeError, match=msg):
Float64Index(["a", "b", 0.0])
Expand Down Expand Up @@ -570,8 +570,8 @@ def test_union_noncomparable(self):

def test_cant_or_shouldnt_cast(self):
msg = (
"String dtype not supported, you may need to explicitly cast to"
" a numeric type"
"String dtype not supported, "
"you may need to explicitly cast to a numeric type"
)
# can't
data = ["foo", "bar", "baz"]
Expand Down Expand Up @@ -655,8 +655,8 @@ def test_constructor(self):

# scalar raise Exception
msg = (
r"Int64Index\(\.\.\.\) must be called with a collection of some"
" kind, 5 was passed"
r"Int64Index\(\.\.\.\) must be called with a collection of some "
"kind, 5 was passed"
)
with pytest.raises(TypeError, match=msg):
Int64Index(5)
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/indexes/timedeltas/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ def test_constructor_coverage(self):

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

msg = (
"Of the four parameters: start, end, periods, and freq, exactly"
" three must be specified"
"Of the four parameters: start, end, periods, and freq, exactly "
"three must be specified"
)
with pytest.raises(ValueError, match=msg):
timedelta_range(periods=10, freq="D")
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/indexes/timedeltas/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def test_to_timedelta_invalid(self):

# time not supported ATM
msg = (
"Value must be Timedelta, string, integer, float, timedelta or"
" convertible"
"Value must be Timedelta, string, integer, float, timedelta or convertible"
)
with pytest.raises(ValueError, match=msg):
to_timedelta(time(second=1))
Expand Down