Update pytest-asyncio to 1.0.0 (#145988)

* Update pytest-asyncio to 1.0.0

* Remove event_loop fixture uses
This commit is contained in:
Marc Mueller
2025-06-02 06:12:22 +02:00
committed by GitHub
parent dd85a1e5f0
commit 5e377b89fc
11 changed files with 22 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
"""Test the auth script to manage local users."""
import argparse
from asyncio import AbstractEventLoop
import asyncio
from collections.abc import Generator
import logging
from typing import Any
@@ -143,7 +143,7 @@ async def test_change_password_invalid_user(
data.validate_login("invalid-user", "new-pass")
def test_parsing_args(event_loop: AbstractEventLoop) -> None:
async def test_parsing_args() -> None:
"""Test we parse args correctly."""
called = False
@@ -158,7 +158,8 @@ def test_parsing_args(event_loop: AbstractEventLoop) -> None:
args = Mock(config="/somewhere/config", func=mock_func)
event_loop = asyncio.get_event_loop()
with patch("argparse.ArgumentParser.parse_args", return_value=args):
script_auth.run(None)
await event_loop.run_in_executor(None, script_auth.run, None)
assert called, "Mock function did not get called"