mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
use asyncio.run in tests instead of awaiting
This commit is contained in:
parent
3b27f7d7e7
commit
af0a1d61b1
@ -1,3 +1,4 @@
|
|||||||
|
import asyncio
|
||||||
import pytest
|
import pytest
|
||||||
import glob
|
import glob
|
||||||
import json
|
import json
|
||||||
@ -76,7 +77,7 @@ def dev(request):
|
|||||||
|
|
||||||
ip = request.config.getoption("--ip")
|
ip = request.config.getoption("--ip")
|
||||||
if ip:
|
if ip:
|
||||||
d = Discover.discover_single(ip)
|
d = asyncio.run(Discover.discover_single(ip))
|
||||||
print(d.model)
|
print(d.model)
|
||||||
if d.model in file:
|
if d.model in file:
|
||||||
return d
|
return d
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
@ -63,7 +64,7 @@ def test_invalid_connection(dev):
|
|||||||
|
|
||||||
def test_query_helper(dev):
|
def test_query_helper(dev):
|
||||||
with pytest.raises(SmartDeviceException):
|
with pytest.raises(SmartDeviceException):
|
||||||
dev._query_helper("test", "testcmd", {})
|
asyncio.run(dev._query_helper("test", "testcmd", {}))
|
||||||
# TODO check for unwrapping?
|
# TODO check for unwrapping?
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user