Skip to content

Commit

Permalink
Fix datetime.utcnow deprecation (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: Duco Sebel <74970928+DCSBL@users.noreply.github.com>
  • Loading branch information
berendhaan and DCSBL authored Apr 22, 2024
1 parent 82c2831 commit b98af51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_frank_energie.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test for Frank Energie."""

from datetime import datetime
from datetime import datetime, timezone

import aiohttp
import pytest
Expand Down Expand Up @@ -316,7 +316,9 @@ async def test_prices(aresponses):

async with aiohttp.ClientSession() as session:
api = FrankEnergie(session)
prices = await api.prices(datetime.utcnow().date(), datetime.utcnow().date())
prices = await api.prices(
datetime.now(timezone.utc), datetime.now(timezone.utc)
)
await api.close()

assert prices.electricity is not None
Expand Down Expand Up @@ -345,7 +347,7 @@ async def test_user_prices(aresponses):

async with aiohttp.ClientSession() as session:
api = FrankEnergie(session, auth_token="a", refresh_token="b") # noqa: S106
prices = await api.user_prices(datetime.utcnow().date(), "1234AB 10")
prices = await api.user_prices(datetime.now(timezone.utc), "1234AB 10")
await api.close()

assert prices.electricity is not None
Expand Down

0 comments on commit b98af51

Please sign in to comment.