tools: bump ruff to 0.4.2 and fix issues

This commit is contained in:
bastimeyer 2024-04-25 20:18:20 +02:00 committed by Sebastian Meyer
parent 7c4bb8c4d6
commit df0d75066d
4 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ pytest-cov
coverage[toml]
# code-linting
ruff ==0.3.7
ruff ==0.4.2
# typing
mypy ==1.9.0

View File

@ -84,7 +84,7 @@ def _sync2async(obj, name, method):
@wraps(meth)
async def wrapper(*args, **kwargs):
async def task():
async def task(): # noqa: RUF029
try:
value = meth(*args, **kwargs)
except Exception as err:

View File

@ -42,7 +42,7 @@ async def cdp_client(session: Streamlink, chromium_webbrowser: Mock, websocket_c
@pytest.fixture()
async def cdp_client_session(request: pytest.FixtureRequest, cdp_client: CDPClient):
def cdp_client_session(request: pytest.FixtureRequest, cdp_client: CDPClient):
target_id = TargetID("01234")
session_id = SessionID("56789")
session = cdp_client.cdp_connection.sessions[session_id] = CDPSession(

View File

@ -114,6 +114,7 @@ class TestLaunchArgs:
@pytest.mark.parametrize("port", [None, 1234])
async def test_launch(monkeypatch: pytest.MonkeyPatch, mock_clock, webbrowser_launch, host, port):
async def fake_find_free_port(_):
await trio.sleep(0)
return 1234
monkeypatch.setattr("streamlink.webbrowser.chromium.find_free_port_ipv4", fake_find_free_port)