mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Fix pytest warnings about asyncio (#397)
Turn on ayncio auto mode for pytest and remove the global async marking flag
This commit is contained in:
parent
9cb2a56405
commit
866c8d6db5
@ -134,10 +134,6 @@ async def handle_turn_on(dev, turn_on):
|
||||
await dev.turn_off()
|
||||
|
||||
|
||||
# to avoid adding this for each async function separately
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
def device_for_file(model):
|
||||
for d in STRIPS:
|
||||
if d in model:
|
||||
|
@ -10,7 +10,6 @@ from .conftest import (
|
||||
non_color_bulb,
|
||||
non_dimmable,
|
||||
non_variable_temp,
|
||||
pytestmark,
|
||||
turn_on,
|
||||
variable_temp,
|
||||
)
|
||||
|
@ -15,7 +15,7 @@ from kasa.cli import (
|
||||
sysinfo,
|
||||
)
|
||||
|
||||
from .conftest import handle_turn_on, pytestmark, turn_on
|
||||
from .conftest import handle_turn_on, turn_on
|
||||
|
||||
|
||||
async def test_sysinfo(dev):
|
||||
|
@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from kasa import SmartDimmer
|
||||
|
||||
from .conftest import dimmer, handle_turn_on, pytestmark, turn_on
|
||||
from .conftest import dimmer, handle_turn_on, turn_on
|
||||
|
||||
|
||||
@dimmer
|
||||
|
@ -6,7 +6,7 @@ import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
|
||||
from kasa import DeviceType, Discover, SmartDevice, SmartDeviceException, protocol
|
||||
from kasa.discover import _DiscoverProtocol
|
||||
|
||||
from .conftest import bulb, dimmer, lightstrip, plug, pytestmark, strip
|
||||
from .conftest import bulb, dimmer, lightstrip, plug, strip
|
||||
|
||||
|
||||
@plug
|
||||
|
@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from kasa import EmeterStatus, SmartDeviceException
|
||||
|
||||
from .conftest import has_emeter, no_emeter, pytestmark
|
||||
from .conftest import has_emeter, no_emeter
|
||||
from .newfakes import CURRENT_CONSUMPTION_SCHEMA
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ import pytest
|
||||
from kasa import DeviceType, SmartLightStrip
|
||||
from kasa.exceptions import SmartDeviceException
|
||||
|
||||
from .conftest import lightstrip, pytestmark
|
||||
from .conftest import lightstrip
|
||||
|
||||
|
||||
@lightstrip
|
||||
|
@ -1,6 +1,6 @@
|
||||
from kasa import DeviceType
|
||||
|
||||
from .conftest import plug, pytestmark
|
||||
from .conftest import plug
|
||||
from .newfakes import PLUG_SCHEMA
|
||||
|
||||
|
||||
|
@ -8,7 +8,6 @@ import pytest
|
||||
|
||||
from ..exceptions import SmartDeviceException
|
||||
from ..protocol import TPLinkSmartHomeProtocol
|
||||
from .conftest import pytestmark
|
||||
|
||||
|
||||
@pytest.mark.parametrize("retry_count", [1, 3, 5])
|
||||
|
@ -6,7 +6,7 @@ import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
|
||||
from kasa import SmartDeviceException
|
||||
from kasa.smartstrip import SmartStripPlug
|
||||
|
||||
from .conftest import handle_turn_on, has_emeter, no_emeter, pytestmark, turn_on
|
||||
from .conftest import handle_turn_on, has_emeter, no_emeter, turn_on
|
||||
from .newfakes import PLUG_SCHEMA, TZ_SCHEMA, FakeTransportProtocol
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@ import pytest
|
||||
|
||||
from kasa import SmartDeviceException, SmartStrip
|
||||
|
||||
from .conftest import handle_turn_on, pytestmark, strip, turn_on
|
||||
from .conftest import handle_turn_on, strip, turn_on
|
||||
|
||||
|
||||
@strip
|
||||
|
@ -80,6 +80,7 @@ verbose = 2
|
||||
markers = [
|
||||
"requires_dummy: test requires dummy data to pass, skipped on real devices",
|
||||
]
|
||||
asyncio_mode = "auto"
|
||||
|
||||
[tool.doc8]
|
||||
paths = ["docs"]
|
||||
|
Loading…
Reference in New Issue
Block a user