Skip to content

Commit

Permalink
TST: Remove tests of naturaldelta when param
Browse files Browse the repository at this point in the history
These tests are irrelevant now that the user is responsible for constructing
a timedelta.
  • Loading branch information
carterbox committed Dec 30, 2021
1 parent f702c1c commit c7ce67e
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions tests/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,37 +333,6 @@ def test_naturaldelta_minimum_unit_explicit(minimum_unit, seconds, expected):
assert humanize.naturaldelta(delta, minimum_unit=minimum_unit) == expected


@pytest.mark.parametrize(
"test_input, when, expected",
[
(NOW, NOW, "a moment"),
(NOW_UTC, NOW_UTC, "a moment"),
],
)
def test_naturaldelta_when_explicit(test_input, when, expected):
# Act / Assert
assert humanize.naturaldelta(test_input, when=when) == expected


@pytest.mark.parametrize(
"value, when",
[
(NOW_UTC, None),
(NOW_UTC, NOW),
(NOW_UTC_PLUS_01_00, None),
(NOW_UTC_PLUS_01_00, NOW),
],
)
def test_naturaldelta_when_missing_tzinfo(value, when):
"""Subtraction `when - value` is not defined by the `datetime` module when
either operand has not timezone-info (`tz=None`) and raises a TypeError.
"""

# Act / Assert
with pytest.raises(TypeError):
humanize.naturaldelta(value, when=when)


@pytest.mark.parametrize(
"seconds, expected",
[
Expand Down

0 comments on commit c7ce67e

Please sign in to comment.