Skip to content

Commit 80d4b82

Browse files
authored
Apply suggestions from code review
1 parent 14dec35 commit 80d4b82

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/pendulum/duration.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,7 @@ def in_minutes(self) -> int:
238238
def in_seconds(self) -> int:
239239
return int(self.total_seconds())
240240

241-
def in_words(
242-
self,
243-
locale: str | None = None,
244-
separator: str = " ",
245-
) -> str:
241+
def in_words(self, locale: str | None = None, separator: str = " ") -> str:
246242
"""
247243
Get the current interval in words in the current locale.
248244
@@ -277,10 +273,8 @@ def in_words(
277273

278274
if not parts:
279275
count: int | str = 0
280-
unit: str
281276
if self.microseconds != 0:
282277
unit = f"units.second.{loaded_locale.plural(0)}"
283-
microseconds = abs(self.microseconds) / 1e6
284278
count = f"{abs(self.microseconds) / 1e6:.2f}"
285279
else:
286280
unit = f"units.microsecond.{loaded_locale.plural(0)}"

tests/duration/test_in_words.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ def test_subseconds():
6565
assert pi.in_words() == "0.12 seconds"
6666

6767

68-
def test_subseconds_with_n_digits():
69-
pi = pendulum.duration(microseconds=123456)
70-
71-
assert pi.in_words(seconds_n_decimal=3) == "0.123 seconds"
72-
73-
7468
def test_subseconds_with_seconds():
7569
pi = pendulum.duration(seconds=12, microseconds=123456)
7670
assert pi.in_words() == "12 seconds"

0 commit comments

Comments
 (0)