Skip to content

Commit fd664de

Browse files
nina-msftCopilot
andauthored
[FIX]: Suppress intentional autouse fixture lint (#184)
## Summary - preserve the two intentionally autouse fixtures while suppressing Ruff 0.16.5's `pytest-fixture-autouse` diagnostic - retain compatibility with `main`'s Ruff 0.16.4 by narrowly ignoring `unused-noqa` only in the affected files - provide prerequisite remediation for Dependabot PR #182 ## Validation - `uv sync --all-extras --frozen` - `uv run ruff check .` - `uv run ruff format --check .` - `uv run flake8` - `uv run ty check` - `uvx --from ruff==0.16.5 ruff check .` --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 7395a37 commit fd664de

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎pyproject.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,15 @@ ignore = [
122122
external = ["RMP001", "RMP002"]
123123

124124
[tool.ruff.lint.per-file-ignores]
125+
"rampart/pytest_plugin/plugin.py" = [
126+
"unused-noqa", # Ruff 0.16.4 does not recognize pytest-fixture-autouse.
127+
]
125128
"scripts/hatch_build.py" = [
126129
"implicit-namespace-package", # Top-level build hook
127130
]
131+
"tests/integration/conftest.py" = [
132+
"unused-noqa", # Ruff 0.16.4 does not recognize pytest-fixture-autouse.
133+
]
128134
"tools/flake8_rampart.py" = [
129135
"implicit-namespace-package", # flake8 imports it as a top-level module
130136
]

‎rampart/pytest_plugin/plugin.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def trial_config(request: pytest.FixtureRequest) -> TrialConfig:
270270
)
271271

272272

273-
@pytest.fixture(autouse=True)
273+
@pytest.fixture(autouse=True) # ruff: ignore[pytest-fixture-autouse, unused-noqa]
274274
def _rampart_collect( # pytest discovers this via autouse=True
275275
request: pytest.FixtureRequest,
276276
) -> Generator[None, None, None]:

‎tests/integration/conftest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
_KEY_VAR = "RAMPART_TEST_OPENAI_KEY"
4646

4747

48-
@pytest_asyncio.fixture(scope="session", autouse=True)
48+
@pytest_asyncio.fixture(scope="session", autouse=True) # ruff: ignore[pytest-fixture-autouse, unused-noqa]
4949
async def pyrit_session_async() -> None:
5050
"""Initialize PyRIT in-memory once per session (autouse).
5151

0 commit comments

Comments
 (0)