Skip to content

Commit 89fb76b

Browse files
committed
Blacken.
1 parent 02e8322 commit 89fb76b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pendulum/duration.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def to_iso8601_string(self):
274274
if self.microseconds:
275275
# no division to avoid possible floating point errors
276276
if not s:
277-
s = "0"
277+
s = "0"
278278
s += ".{:0>6}".format(self.microseconds).rstrip("0")
279279
if s:
280280
time += "{}S".format(s)
@@ -286,7 +286,12 @@ def to_iso8601_string(self):
286286
# check if PnW representation is suitable
287287
# i.e. only days
288288
# TODO abs?
289-
if (days_alone % DAYS_PER_WEEK == 0 and not self._years and not self._months and len(time) == 1):
289+
if (
290+
days_alone % DAYS_PER_WEEK == 0
291+
and not self._years
292+
and not self._months
293+
and len(time) == 1
294+
):
290295
w = days_alone // DAYS_PER_WEEK
291296
rep = "P{}W".format(w)
292297
return rep

tests/duration/test_to_iso8601.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33

44
def test_all():
5-
d = pendulum.duration(years=2, months=3, days=4, hours=5, minutes=6, seconds=7, microseconds=50)
5+
d = pendulum.duration(
6+
years=2, months=3, days=4, hours=5, minutes=6, seconds=7, microseconds=50
7+
)
68

79
expected = "P2Y3M4DT5H6M7.00005S"
810
assert d.to_iso8601_string() == expected
@@ -107,4 +109,3 @@ def test_empty():
107109
assert parsed.minutes == 0
108110
assert parsed.remaining_seconds == 0
109111
assert parsed.microseconds == 0
110-

0 commit comments

Comments
 (0)