mirror of https://github.com/streamlink/streamlink
tools: bump ruff to 0.4.2 and fix issues
This commit is contained in:
parent
7c4bb8c4d6
commit
df0d75066d
|
@ -15,7 +15,7 @@ pytest-cov
|
|||
coverage[toml]
|
||||
|
||||
# code-linting
|
||||
ruff ==0.3.7
|
||||
ruff ==0.4.2
|
||||
|
||||
# typing
|
||||
mypy ==1.9.0
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue