Update dependency pytest-asyncio to v1.2.0 (#492)
* Update dependency pytest-asyncio to v1.2.0 * don't stop the event loop between test set the loop_scope to session for async tests * remove loop_scope="session" --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Stefan Allius <stefan.allius@t-online.de>
This commit is contained in:
@@ -99,7 +99,7 @@ def patch_healthy():
|
||||
with patch.object(AsyncStream, 'healthy') as conn:
|
||||
yield conn
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_method_calls(my_loop, patch_healthy):
|
||||
spy = patch_healthy
|
||||
reader = FakeReader()
|
||||
@@ -119,7 +119,7 @@ async def test_method_calls(my_loop, patch_healthy):
|
||||
cnt += 1
|
||||
assert cnt == 0
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_remote_conn(my_loop, config_conn, patch_open_connection):
|
||||
_ = config_conn
|
||||
_ = patch_open_connection
|
||||
@@ -137,7 +137,7 @@ async def test_remote_conn(my_loop, config_conn, patch_open_connection):
|
||||
cnt += 1
|
||||
assert cnt == 0
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_remote_except(my_loop, config_conn, patch_open_connection):
|
||||
_ = config_conn
|
||||
_ = patch_open_connection
|
||||
@@ -164,7 +164,7 @@ async def test_remote_except(my_loop, config_conn, patch_open_connection):
|
||||
cnt += 1
|
||||
assert cnt == 0
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_mqtt_publish(my_loop, config_conn, patch_open_connection):
|
||||
_ = config_conn
|
||||
_ = patch_open_connection
|
||||
@@ -191,7 +191,7 @@ async def test_mqtt_publish(my_loop, config_conn, patch_open_connection):
|
||||
await inverter.async_publ_mqtt()
|
||||
assert Infos.new_stat_data['proxy'] == False
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_mqtt_err(my_loop, config_conn, patch_open_connection, patch_mqtt_err):
|
||||
_ = config_conn
|
||||
_ = patch_open_connection
|
||||
@@ -208,7 +208,7 @@ async def test_mqtt_err(my_loop, config_conn, patch_open_connection, patch_mqtt_
|
||||
await inverter.async_publ_mqtt()
|
||||
assert stream.new_data['inverter'] == True
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.asyncio(loop_scope="session")
|
||||
async def test_mqtt_except(my_loop, config_conn, patch_open_connection, patch_mqtt_except):
|
||||
_ = config_conn
|
||||
_ = patch_open_connection
|
||||
|
||||
Reference in New Issue
Block a user