Skip to content

Commit 99250e8

Browse files
author
MomIsBestFriend
committed
STY: Spaces in wrong place
1 parent 08b70d8 commit 99250e8

18 files changed

+64
-71
lines changed

pandas/tests/arrays/categorical/test_api.py

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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/arrays/categorical/test_repr.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ def test_categorical_repr_datetime(self):
151151
"[2011-01-01 09:00:00, 2011-01-01 10:00:00, 2011-01-01 11:00:00, "
152152
"2011-01-01 12:00:00, 2011-01-01 13:00:00]\n"
153153
"Categories (5, datetime64[ns]): [2011-01-01 09:00:00, "
154-
"2011-01-01 10:00:00, 2011-01-01 11:00:00,\n"
155-
" 2011-01-01 12:00:00, "
154+
"2011-01-01 10:00:00, 2011-01-01 11:00:00,"
155+
"\n "
156+
"2011-01-01 12:00:00, "
156157
"2011-01-01 13:00:00]"
157158
""
158159
)
@@ -165,8 +166,8 @@ def test_categorical_repr_datetime(self):
165166
"2011-01-01 10:00:00, 2011-01-01 11:00:00, 2011-01-01 12:00:00, "
166167
"2011-01-01 13:00:00]\n"
167168
"Categories (5, datetime64[ns]): [2011-01-01 09:00:00, "
168-
"2011-01-01 10:00:00, 2011-01-01 11:00:00,\n"
169-
" 2011-01-01 12:00:00, "
169+
"2011-01-01 10:00:00, 2011-01-01 11:00:00,"
170+
"\n 2011-01-01 12:00:00, "
170171
"2011-01-01 13:00:00]"
171172
)
172173

@@ -179,10 +180,10 @@ def test_categorical_repr_datetime(self):
179180
"2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00, "
180181
"2011-01-01 13:00:00-05:00]\n"
181182
"Categories (5, datetime64[ns, US/Eastern]): "
182-
"[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,\n"
183-
" "
184-
"2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,\n"
185-
" "
183+
"[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,"
184+
"\n "
185+
"2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,"
186+
"\n "
186187
"2011-01-01 13:00:00-05:00]"
187188
)
188189

@@ -196,10 +197,10 @@ def test_categorical_repr_datetime(self):
196197
"2011-01-01 10:00:00-05:00, 2011-01-01 11:00:00-05:00, "
197198
"2011-01-01 12:00:00-05:00, 2011-01-01 13:00:00-05:00]\n"
198199
"Categories (5, datetime64[ns, US/Eastern]): "
199-
"[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,\n"
200-
" "
201-
"2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,\n"
202-
" "
200+
"[2011-01-01 09:00:00-05:00, 2011-01-01 10:00:00-05:00,"
201+
"\n "
202+
"2011-01-01 11:00:00-05:00, 2011-01-01 12:00:00-05:00,"
203+
"\n "
203204
"2011-01-01 13:00:00-05:00]"
204205
)
205206

pandas/tests/arrays/test_integer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def test_repr_array_long():
9898
data = integer_array([1, 2, None] * 1000)
9999
expected = (
100100
"<IntegerArray>\n"
101-
"[ 1, 2, NA, 1, 2, NA, 1, 2, NA, 1,\n"
102-
" ...\n"
103-
" NA, 1, 2, NA, 1, 2, NA, 1, 2, NA]\n"
101+
"[ 1, 2, NA, 1, 2, NA, 1, 2, NA, 1,\n "
102+
"...\n "
103+
"NA, 1, 2, NA, 1, 2, NA, 1, 2, NA]\n"
104104
"Length: 3000, dtype: Int64"
105105
)
106106
result = repr(data)

pandas/tests/arrays/test_period.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,13 @@ def test_repr_large():
270270
expected = (
271271
"<PeriodArray>\n"
272272
"['2000-01-01', '2001-01-01', '2000-01-01', '2001-01-01', "
273-
"'2000-01-01',\n"
274-
" '2001-01-01', '2000-01-01', '2001-01-01', '2000-01-01', "
275-
"'2001-01-01',\n"
276-
" ...\n"
277-
" '2000-01-01', '2001-01-01', '2000-01-01', '2001-01-01', "
278-
"'2000-01-01',\n"
279-
" '2001-01-01', '2000-01-01', '2001-01-01', '2000-01-01', "
273+
"'2000-01-01',\n "
274+
"'2001-01-01', '2000-01-01', '2001-01-01', '2000-01-01', "
275+
"'2001-01-01',\n "
276+
"...\n "
277+
"'2000-01-01', '2001-01-01', '2000-01-01', '2001-01-01', "
278+
"'2000-01-01',\n "
279+
"'2001-01-01', '2000-01-01', '2001-01-01', '2000-01-01', "
280280
"'2001-01-01']\n"
281281
"Length: 1000, dtype: period[D]"
282282
)

pandas/tests/frame/methods/test_quantile.py

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,8 +2402,8 @@ def test_east_asian_unicode_series(self):
24022402

24032403
s.index = ["ああ", "いいいい", "う", "えええ"]
24042404
expected = (
2405-
"ああ あ\n"
2406-
" ... \n"
2405+
"ああ あ\n "
2406+
"... \n"
24072407
"えええ ええええ\n"
24082408
"Name: おおおおおおお, Length: 4, dtype: object"
24092409
)
@@ -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

Lines changed: 4 additions & 8 deletions
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 4 deletions
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)