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:
renovate[bot]
2025-09-15 22:50:47 +02:00
committed by GitHub
parent 45ab95a6b3
commit 2019037ab0
14 changed files with 181 additions and 181 deletions

View File

@@ -189,7 +189,7 @@ def patch_mqtt_except():
with patch.object(Mqtt, 'publish', new_publish) as conn:
yield conn
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_conn(config_conn, patch_open):
_ = config_conn
_ = patch_open
@@ -209,7 +209,7 @@ async def test_modbus_conn(config_conn, patch_open):
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_no_cnf():
_ = config_conn
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@@ -217,7 +217,7 @@ async def test_modbus_no_cnf():
ModbusTcp(loop)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_timeout(config_conn, patch_open_timeout):
_ = config_conn
_ = patch_open_timeout
@@ -235,7 +235,7 @@ async def test_modbus_timeout(config_conn, patch_open_timeout):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_value_err(config_conn, patch_open_value_error):
_ = config_conn
_ = patch_open_value_error
@@ -253,7 +253,7 @@ async def test_modbus_value_err(config_conn, patch_open_value_error):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_conn_abort(config_conn, patch_open_conn_abort):
_ = config_conn
_ = patch_open_conn_abort
@@ -271,7 +271,7 @@ async def test_modbus_conn_abort(config_conn, patch_open_conn_abort):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_cnf2(config_conn, patch_no_mqtt, patch_open):
_ = config_conn
_ = patch_open
@@ -295,7 +295,7 @@ async def test_modbus_cnf2(config_conn, patch_no_mqtt, patch_open):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_modbus_cnf3(config_conn, patch_no_mqtt, patch_open):
_ = config_conn
_ = patch_open
@@ -326,7 +326,7 @@ async def test_modbus_cnf3(config_conn, patch_no_mqtt, patch_open):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_mqtt_err(config_conn, patch_mqtt_err, patch_open):
_ = config_conn
_ = patch_open
@@ -357,7 +357,7 @@ async def test_mqtt_err(config_conn, patch_mqtt_err, patch_open):
await asyncio.sleep(0.01)
assert Infos.stat['proxy']['Inverter_Cnt'] == 0
@pytest.mark.asyncio
@pytest.mark.asyncio(loop_scope="session")
async def test_mqtt_except(config_conn, patch_mqtt_except, patch_open):
_ = config_conn
_ = patch_open