Skip to content

Commit 53c8c9b

Browse files
committed
code formatting changes
1 parent f6f131b commit 53c8c9b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

pandas/tests/indexes/datetimes/test_scalar_compat.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -174,36 +174,36 @@ def test_ceil_floor_edge(self, test_input, rounder, freq, expected):
174174
('2018-01-01', '12H', 25),
175175
('2018-01-01 0:0:0.124999', '1ns', 1000),
176176
])
177-
@pytest.mark.parametrize('rounding_freq', [
177+
@pytest.mark.parametrize('round_freq', [
178178
'2ns', '3ns', '4ns', '5ns', '6ns', '7ns',
179179
'250ns', '500ns', '750ns',
180180
'1us', '19us', '250us', '500us', '750us',
181181
'1s', '2s', '3s',
182182
'12H', '1D',
183183
])
184-
def test_round_int64(self, start, index_freq, periods, rounding_freq):
184+
def test_round_int64(self, start, index_freq, periods, round_freq):
185185
dt = DatetimeIndex(start=start, freq=index_freq, periods=periods)
186-
unit = to_offset(rounding_freq).nanos
186+
unit = to_offset(round_freq).nanos
187187

188188
# test floor
189-
result = dt.floor(rounding_freq)
189+
result = dt.floor(round_freq)
190190
diff = dt.asi8 - result.asi8
191191
mod = result.asi8 % unit
192-
assert (mod == 0).all(), "floor not a %s multiple" % (rounding_freq, )
192+
assert (mod == 0).all(), "floor not a {} multiple".format(round_freq)
193193
assert (0 <= diff).all() and (diff < unit).all(), "floor error"
194194

195195
# test ceil
196-
result = dt.ceil(rounding_freq)
196+
result = dt.ceil(round_freq)
197197
diff = result.asi8 - dt.asi8
198198
mod = result.asi8 % unit
199-
assert (mod == 0).all(), "ceil not a %s multiple" % (rounding_freq, )
199+
assert (mod == 0).all(), "ceil not a {} multiple".format(round_freq)
200200
assert (0 <= diff).all() and (diff < unit).all(), "ceil error"
201201

202202
# test round
203-
result = dt.round(rounding_freq)
203+
result = dt.round(round_freq)
204204
diff = abs(result.asi8 - dt.asi8)
205205
mod = result.asi8 % unit
206-
assert (mod == 0).all(), "round not a %s multiple" % (rounding_freq, )
206+
assert (mod == 0).all(), "round not a {} multiple".format(round_freq)
207207
assert (diff <= unit // 2).all(), "round error"
208208
if unit % 2 == 0:
209209
assert (

pandas/tests/scalar/timestamp/test_unary_ops.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,17 @@ def test_round_int64(self, timestamp, freq):
179179

180180
# test floor
181181
result = dt.floor(freq)
182-
assert result.value % unit == 0, "floor not a %s multiple" % (freq, )
182+
assert result.value % unit == 0, "floor not a {} multiple".format(freq)
183183
assert 0 <= dt.value - result.value < unit, "floor error"
184184

185185
# test ceil
186186
result = dt.ceil(freq)
187-
assert result.value % unit == 0, "ceil not a %s multiple" % (freq, )
187+
assert result.value % unit == 0, "ceil not a {} multiple".format(freq)
188188
assert 0 <= result.value - dt.value < unit, "ceil error"
189189

190190
# test round
191191
result = dt.round(freq)
192-
assert result.value % unit == 0, "round not a %s multiple" % (freq, )
192+
assert result.value % unit == 0, "round not a {} multiple".format(freq)
193193
assert abs(result.value - dt.value) <= unit // 2, "round error"
194194
if unit % 2 == 0 and abs(result.value - dt.value) == unit // 2:
195195
# round half to even

0 commit comments

Comments
 (0)