Skip to content

Commit

Permalink
feat(python): removed date_2022_01_01 & date_2022_01_02 fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
MatveyF committed Feb 19, 2023
1 parent c9c47a0 commit e14a38b
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions py-polars/tests/unit/namespaces/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
from polars.internals.type_aliases import TimeUnit


@pytest.fixture()
def date_2022_01_01() -> datetime:
return datetime(2022, 1, 1)


@pytest.fixture()
def date_2022_01_02() -> datetime:
return datetime(2022, 1, 2)


@pytest.fixture()
def series_of_int_dates() -> pl.Series:
return pl.Series([10000, 20000, 30000], dtype=pl.Date)
Expand Down Expand Up @@ -125,10 +115,8 @@ def test_strptime_fractional_seconds(series_of_str_dates: pl.Series) -> None:
def test_duration_extract_times(
unit_attr: str,
expected: pl.Series,
date_2022_01_01: datetime,
date_2022_01_02: datetime,
) -> None:
duration = pl.Series([date_2022_01_02]) - pl.Series([date_2022_01_01])
duration = pl.Series([datetime(2022, 1, 2)]) - pl.Series([datetime(2022, 1, 1)])

assert_series_equal(getattr(duration.dt, unit_attr)(), expected)

Expand All @@ -145,10 +133,8 @@ def test_duration_extract_times(
def test_truncate(
time_unit: TimeUnit,
every: str | timedelta,
date_2022_01_01: datetime,
date_2022_01_02: datetime,
) -> None:
start, stop = date_2022_01_01, date_2022_01_02
start, stop = datetime(2022, 1, 1), datetime(2022, 1, 2)
s = pl.date_range(
start,
stop,
Expand Down Expand Up @@ -181,10 +167,8 @@ def test_truncate(
def test_round(
time_unit: TimeUnit,
every: str | timedelta,
date_2022_01_01: datetime,
date_2022_01_02: datetime,
) -> None:
start, stop = date_2022_01_01, date_2022_01_02
start, stop = datetime(2022, 1, 1), datetime(2022, 1, 2)
s = pl.date_range(
start,
stop,
Expand Down

0 comments on commit e14a38b

Please sign in to comment.