Skip to content

Commit

Permalink
Merge pull request #109 from hugovk/refactor-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 13, 2023
2 parents 0de0fc6 + 63680b5 commit 7e20f6e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/test_time.py
Expand Up @@ -74,10 +74,6 @@ def test_date_and_delta() -> None:
# Tests for the public interface of humanize.time


def nd_nomonths(d: dt.timedelta) -> str:
return humanize.naturaldelta(d, months=False)


@pytest.mark.parametrize(
"test_input, expected",
[
Expand All @@ -88,7 +84,7 @@ def nd_nomonths(d: dt.timedelta) -> str:
],
)
def test_naturaldelta_nomonths(test_input: dt.timedelta, expected: str) -> None:
assert nd_nomonths(test_input) == expected
assert humanize.naturaldelta(test_input, months=False) == expected


@pytest.mark.parametrize(
Expand Down Expand Up @@ -173,10 +169,6 @@ def test_naturaltime(test_input: dt.datetime, expected: str) -> None:
assert humanize.naturaltime(test_input) == expected


def nt_nomonths(d: dt.datetime) -> str:
return humanize.naturaltime(d, months=False)


@freeze_time("2020-02-02")
@pytest.mark.parametrize(
"test_input, expected",
Expand Down Expand Up @@ -215,7 +207,7 @@ def nt_nomonths(d: dt.datetime) -> str:
],
)
def test_naturaltime_nomonths(test_input: dt.datetime, expected: str) -> None:
assert nt_nomonths(test_input) == expected
assert humanize.naturaltime(test_input, months=False) == expected


@freeze_time("2020-02-02")
Expand Down

0 comments on commit 7e20f6e

Please sign in to comment.