Skip to content

Commit 2baf788

Browse files
ShaharNavehTomAugspurger
authored andcommitted
STY: Spaces in wrong place (pandas-dev#30781)
* STY: Spaces in wrong place
1 parent a879f03 commit 2baf788

15 files changed

+39
-47
lines changed

pandas/tests/arrays/categorical/test_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def test_rename_categories(self):
8787
def test_rename_categories_wrong_length_raises(self, new_categories):
8888
cat = Categorical(["a", "b", "c", "a"])
8989
msg = (
90-
"new categories need to have the same number of items as the"
91-
" old categories!"
90+
"new categories need to have the same number of items as the "
91+
"old categories!"
9292
)
9393
with pytest.raises(ValueError, match=msg):
9494
cat.rename_categories(new_categories)

pandas/tests/arrays/categorical/test_indexing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ def test_categories_assigments(self):
157157
def test_categories_assigments_wrong_length_raises(self, new_categories):
158158
cat = Categorical(["a", "b", "c", "a"])
159159
msg = (
160-
"new categories need to have the same number of items"
161-
" as the old categories!"
160+
"new categories need to have the same number of items "
161+
"as the old categories!"
162162
)
163163
with pytest.raises(ValueError, match=msg):
164164
cat.categories = new_categories

pandas/tests/arrays/categorical/test_operators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ def test_comparison_with_unknown_scalars(self):
172172
cat = Categorical([1, 2, 3], ordered=True)
173173

174174
msg = (
175-
"Cannot compare a Categorical for op __{}__ with a scalar,"
176-
" which is not a category"
175+
"Cannot compare a Categorical for op __{}__ with a scalar, "
176+
"which is not a category"
177177
)
178178
with pytest.raises(TypeError, match=msg.format("lt")):
179179
cat < 4

pandas/tests/frame/methods/test_quantile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def test_quantile_axis_parameter(self):
103103
with pytest.raises(ValueError, match=msg):
104104
df.quantile(0.1, axis=-1)
105105
msg = (
106-
"No axis named column for object type"
107-
" <class 'pandas.core.frame.DataFrame'>"
106+
"No axis named column for object type "
107+
"<class 'pandas.core.frame.DataFrame'>"
108108
)
109109
with pytest.raises(ValueError, match=msg):
110110
df.quantile(0.1, axis="column")

pandas/tests/io/formats/test_format.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2659,14 +2659,14 @@ def test_format_explicit(self):
26592659
assert exp == res
26602660
res = repr(test_sers["asc"])
26612661
exp = (
2662-
"0 a\n1 ab\n ... \n4 abcde\n5"
2663-
" abcdef\ndtype: object"
2662+
"0 a\n1 ab\n ... \n4 abcde\n5 "
2663+
"abcdef\ndtype: object"
26642664
)
26652665
assert exp == res
26662666
res = repr(test_sers["desc"])
26672667
exp = (
2668-
"5 abcdef\n4 abcde\n ... \n1 ab\n0"
2669-
" a\ndtype: object"
2668+
"5 abcdef\n4 abcde\n ... \n1 ab\n0 "
2669+
"a\ndtype: object"
26702670
)
26712671
assert exp == res
26722672

pandas/tests/io/formats/test_style.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -530,20 +530,17 @@ def test_bar_align_left_0points(self):
530530
(1, 0): [
531531
"width: 10em",
532532
" height: 80%",
533-
"background: linear-gradient(90deg,#d65f5f 50.0%,"
534-
" transparent 50.0%)",
533+
"background: linear-gradient(90deg,#d65f5f 50.0%, transparent 50.0%)",
535534
],
536535
(1, 1): [
537536
"width: 10em",
538537
" height: 80%",
539-
"background: linear-gradient(90deg,#d65f5f 50.0%,"
540-
" transparent 50.0%)",
538+
"background: linear-gradient(90deg,#d65f5f 50.0%, transparent 50.0%)",
541539
],
542540
(1, 2): [
543541
"width: 10em",
544542
" height: 80%",
545-
"background: linear-gradient(90deg,#d65f5f 50.0%,"
546-
" transparent 50.0%)",
543+
"background: linear-gradient(90deg,#d65f5f 50.0%, transparent 50.0%)",
547544
],
548545
(2, 0): [
549546
"width: 10em",
@@ -572,8 +569,7 @@ def test_bar_align_left_0points(self):
572569
(0, 1): [
573570
"width: 10em",
574571
" height: 80%",
575-
"background: linear-gradient(90deg,#d65f5f 50.0%,"
576-
" transparent 50.0%)",
572+
"background: linear-gradient(90deg,#d65f5f 50.0%, transparent 50.0%)",
577573
],
578574
(0, 2): [
579575
"width: 10em",

pandas/tests/io/formats/test_to_html.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
import pandas.io.formats.format as fmt
1313

1414
lorem_ipsum = (
15-
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
16-
" tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
17-
" veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex"
18-
" ea commodo consequat. Duis aute irure dolor in reprehenderit in"
19-
" voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur"
20-
" sint occaecat cupidatat non proident, sunt in culpa qui officia"
21-
" deserunt mollit anim id est laborum."
15+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
16+
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
17+
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex "
18+
"ea commodo consequat. Duis aute irure dolor in reprehenderit in "
19+
"voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur "
20+
"sint occaecat cupidatat non proident, sunt in culpa qui officia "
21+
"deserunt mollit anim id est laborum."
2222
)
2323

2424

pandas/tests/io/test_stata.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1296,8 +1296,8 @@ def test_write_variable_label_errors(self):
12961296
}
12971297

12981298
msg = (
1299-
"Variable labels must contain only characters that can be"
1300-
" encoded in Latin-1"
1299+
"Variable labels must contain only characters that can be "
1300+
"encoded in Latin-1"
13011301
)
13021302
with pytest.raises(ValueError, match=msg):
13031303
with tm.ensure_clean() as path:
@@ -1467,8 +1467,8 @@ def test_out_of_range_float(self):
14671467

14681468
original.loc[2, "ColumnTooBig"] = np.inf
14691469
msg = (
1470-
"Column ColumnTooBig has a maximum value of infinity which"
1471-
" is outside the range supported by Stata"
1470+
"Column ColumnTooBig has a maximum value of infinity which "
1471+
"is outside the range supported by Stata"
14721472
)
14731473
with pytest.raises(ValueError, match=msg):
14741474
with tm.ensure_clean() as path:

pandas/tests/series/indexing/test_boolean.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ def test_where_error():
285285
with pytest.raises(ValueError, match=msg):
286286
s[[True, False]] = [0, 2, 3]
287287
msg = (
288-
"NumPy boolean array indexing assignment cannot assign 0 input"
289-
" values to the 1 output values where the mask is true"
288+
"NumPy boolean array indexing assignment cannot assign 0 input "
289+
"values to the 1 output values where the mask is true"
290290
)
291291
with pytest.raises(ValueError, match=msg):
292292
s[[True, False]] = []

pandas/tests/series/indexing/test_indexing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ def test_getitem_dataframe():
294294
s = pd.Series(10, index=rng)
295295
df = pd.DataFrame(rng, index=rng)
296296
msg = (
297-
"Indexing a Series with DataFrame is not supported,"
298-
" use the appropriate DataFrame column"
297+
"Indexing a Series with DataFrame is not supported, "
298+
"use the appropriate DataFrame column"
299299
)
300300
with pytest.raises(TypeError, match=msg):
301301
s[df > 5]

pandas/tests/series/methods/test_rank.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ def test_rank_signature(self):
203203
s = Series([0, 1])
204204
s.rank(method="average")
205205
msg = (
206-
"No axis named average for object type"
207-
" <class 'pandas.core.series.Series'>"
206+
"No axis named average for object type <class 'pandas.core.series.Series'>"
208207
)
209208
with pytest.raises(ValueError, match=msg):
210209
s.rank("average")

pandas/tests/series/methods/test_sort_values.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def test_sort_values(self, datetime_series):
7777
s = df.iloc[:, 0]
7878

7979
msg = (
80-
"This Series is a view of some other array, to sort in-place"
81-
" you must create a copy"
80+
"This Series is a view of some other array, to sort in-place "
81+
"you must create a copy"
8282
)
8383
with pytest.raises(ValueError, match=msg):
8484
s.sort_values(inplace=True)

pandas/tests/series/test_alter_axes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def test_setindex(self, string_series):
1919

2020
# wrong length
2121
msg = (
22-
"Length mismatch: Expected axis has 30 elements, new"
23-
" values have 29 elements"
22+
"Length mismatch: Expected axis has 30 elements, "
23+
"new values have 29 elements"
2424
)
2525
with pytest.raises(ValueError, match=msg):
2626
string_series.index = np.arange(len(string_series) - 1)

pandas/tests/series/test_missing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,8 @@ def test_interpolate_index_values(self):
11801180
def test_interpolate_non_ts(self):
11811181
s = Series([1, 3, np.nan, np.nan, np.nan, 11])
11821182
msg = (
1183-
"time-weighted interpolation only works on Series or DataFrames"
1184-
" with a DatetimeIndex"
1183+
"time-weighted interpolation only works on Series or DataFrames "
1184+
"with a DatetimeIndex"
11851185
)
11861186
with pytest.raises(ValueError, match=msg):
11871187
s.interpolate(method="time")

pandas/tests/series/test_timeseries.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,7 @@ def test_between_time_raises(self):
501501
def test_between_time_types(self):
502502
# GH11818
503503
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
504-
msg = (
505-
r"Cannot convert arg \[datetime\.datetime\(2010, 1, 2, 1, 0\)\]"
506-
" to a time"
507-
)
504+
msg = r"Cannot convert arg \[datetime\.datetime\(2010, 1, 2, 1, 0\)\] to a time"
508505
with pytest.raises(ValueError, match=msg):
509506
rng.indexer_between_time(datetime(2010, 1, 2, 1), datetime(2010, 1, 2, 5))
510507

0 commit comments

Comments
 (0)