mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-07 11:14:02 +00:00
Remove support for python <3.11 (#1273)
Python 3.11 ships with latest Debian Bookworm. pypy is not that widely used with this library based on statistics. It could be added back when pypy supports python 3.11.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import inspect
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
|
||||
import pytest
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
@@ -58,10 +57,6 @@ async def test_childdevice_update(dev, dummy_protocol, mocker):
|
||||
|
||||
|
||||
@strip_smart
|
||||
@pytest.mark.skipif(
|
||||
sys.version_info < (3, 11),
|
||||
reason="exceptiongroup requires python3.11+",
|
||||
)
|
||||
async def test_childdevice_properties(dev: SmartChildDevice):
|
||||
"""Check that accessing childdevice properties do not raise exceptions."""
|
||||
assert len(dev.children) > 0
|
||||
@@ -125,7 +120,7 @@ async def test_parent_property(dev: Device):
|
||||
|
||||
|
||||
@has_children_smart
|
||||
@pytest.mark.requires_dummy()
|
||||
@pytest.mark.requires_dummy
|
||||
async def test_child_time(dev: Device, freezer: FrozenDateTimeFactory):
|
||||
"""Test a child device gets the time from it's parent module.
|
||||
|
||||
@@ -135,7 +130,7 @@ async def test_child_time(dev: Device, freezer: FrozenDateTimeFactory):
|
||||
if not dev.children:
|
||||
pytest.skip(f"Device {dev} fixture does not have any children")
|
||||
|
||||
fallback_time = datetime.now(timezone.utc).astimezone().replace(microsecond=0)
|
||||
fallback_time = datetime.now(UTC).astimezone().replace(microsecond=0)
|
||||
assert dev.parent is None
|
||||
for child in dev.children:
|
||||
assert child.time != fallback_time
|
||||
|
Reference in New Issue
Block a user