mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +08:00
ci/lint: per-file ignores for tests in ruff and basedpyright
Relax ANN/ARG/PLR/C901 and related rules under tests/**; silence noisy basedpyright reports for test fakes and private helpers.
This commit is contained in:
@@ -42,7 +42,7 @@ def test_open_in_editor_splits_args(tmp_path: Path, monkeypatch: pytest.MonkeyPa
|
||||
path = tmp_path / "plyngent.toml"
|
||||
calls: list[list[str]] = []
|
||||
|
||||
def fake_run(argv: list[str], check: bool = False) -> object: # noqa: FBT001, FBT002
|
||||
def fake_run(argv: list[str], check: bool = False) -> object:
|
||||
del check
|
||||
calls.append(list(argv))
|
||||
|
||||
@@ -112,7 +112,7 @@ def test_config_edit_command(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) ->
|
||||
monkeypatch.setenv("EDITOR", "true")
|
||||
calls: list[list[str]] = []
|
||||
|
||||
def fake_run(argv: list[str], check: bool = False) -> object: # noqa: FBT001, FBT002
|
||||
def fake_run(argv: list[str], check: bool = False) -> object:
|
||||
del check
|
||||
calls.append(list(argv))
|
||||
|
||||
|
||||
@@ -138,8 +138,8 @@ async def test_history(state: ReplState, capsys: pytest.CaptureFixture[str]) ->
|
||||
|
||||
async def test_rounds(state: ReplState) -> None:
|
||||
assert await handle_slash(state, "/rounds 40") is True
|
||||
assert state.max_rounds == 40 # noqa: PLR2004
|
||||
assert state.agent.max_rounds == 40 # noqa: PLR2004
|
||||
assert state.max_rounds == 40
|
||||
assert state.agent.max_rounds == 40
|
||||
|
||||
|
||||
async def test_status_shows_context_chars(
|
||||
|
||||
@@ -112,9 +112,9 @@ async def test_auto_retry_eventually_succeeds(monkeypatch: pytest.MonkeyPatch) -
|
||||
delays=(0.01, 0.01, 0.01),
|
||||
)
|
||||
assert ok is True
|
||||
assert client.calls == 3 # noqa: PLR2004
|
||||
assert client.calls == 3
|
||||
loaded = await store.list_messages(session.sid)
|
||||
assert len(loaded) == 2 # noqa: PLR2004
|
||||
assert len(loaded) == 2
|
||||
assert isinstance(loaded[0], UserChatMessage)
|
||||
assert loaded[0].content == "hello"
|
||||
await store.close()
|
||||
@@ -205,7 +205,7 @@ async def test_manual_retry_after_exhausted(monkeypatch: pytest.MonkeyPatch) ->
|
||||
assert ok2 is True
|
||||
assert agent.pending_retry_text is None
|
||||
loaded = await store.list_messages(session.sid)
|
||||
assert len(loaded) == 2 # noqa: PLR2004
|
||||
assert len(loaded) == 2
|
||||
assert isinstance(loaded[0], UserChatMessage)
|
||||
assert loaded[0].content == "hold-me"
|
||||
await store.close()
|
||||
|
||||
Reference in New Issue
Block a user