fix(tests): resolve ruff lint failures in test suite
Metadata
Current evaluation
Merged fix for four ruff lint failures in the test suite. Resolved PLR0917 errors by marking extra pytest parameters as keyword-only, and fixed ISC004 errors by parenthesizing implicit string concatenations. Lint and test checks now pass.
Suggested action: —
No scores available.
Issue body
## Summary
Fixes the 4 ruff lint errors currently failing CI (see [run 31619515654](https://github.com/canonical/charmcraft/actions/runs/31619515654/job/94190595975?pr=2818)):
- `PLR0917` (too many positional arguments, >8) in `tests/conftest.py`'s `service_factory` fixture and `tests/unit/commands/test_store.py`'s `test_login_export` test — fixed by marking the extra parameters keyword-only with a bare `*`. This is safe because pytest injects fixtures/parametrized arguments by name, not position.
- `ISC004` (unparenthesized implicit string concatenation in a collection) in `tests/unit/parts/plugins/test_charm.py` and `tests/unit/parts/plugins/test_reactive.py` — fixed by wrapping the concatenated string literals in parentheses.
## Testing
- `ruff check .` passes with no errors.
- `pytest` on all affected tests passes locally (146 passed for `test_store.py`/`test_charm.py`/`test_reactive.py`).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for four ruff lint failures in the test suite. Resolved PLR0917 errors by marking extra pytest parameters as keyword-only, and fixed ISC004 errors by parenthesizing implicit string concatenations. Lint and test checks now pass. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
5
Confidence:
90
|
needs review | Resolves 4 ruff lint errors in the test suite by making extra pytest arguments keyword-only and parenthesizing string concatenations. Approved by 2 reviewers, but CI shows failing slow tests, lint checks, and snap-build. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
5
Confidence:
90
|
needs review | Resolves 4 ruff lint errors in the test suite by making extra fixture parameters keyword-only and parenthesizing implicit string concatenations. Approved by 1 reviewer, ready for merge. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
5
Confidence:
90
|
needs review | Fixes 4 ruff lint errors in the test suite by marking extra fixture parameters keyword-only and wrapping implicit string concatenations in parentheses. Currently passing CI checks except for unrelated slow tests and snap-build. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
5
Confidence:
90
|
needs review | Fixes 4 ruff lint errors in the test suite by making extra fixture parameters keyword-only and parenthesizing implicit string concatenations. Currently awaiting maintainer review with CI lint check failing but other checks passing. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1154 fix(lint): ignore PLR0917 in tests alongside PLR0913 | craft-application | merged | Merged a lint fix extending the PLR0913 test ignore to also suppress PLR0917. This resolves nine lint errors in test files caused by pytest fixtures and parametrization, allowing make lint-ruff to pass. Approved by two reviewers with all CI checks passing. | |
| #33 lint: fix lint issues with newer ruff | craft-archives | merged | Merged to resolve linting failures introduced by a newer ruff version. Changes fix style checks across three files. Review approved, CI passed, and coverage remained unchanged. Additional unit tests were deferred to a separate tracking ticket. | |
| #803 style: fix linting issues with ruff 0.12 | craft-application | merged | Merged after approval by two reviewers. Resolves linting failures introduced by ruff 0.12 across 14 files. CI passed for fast tests, linting, and security scans, while slow test failures were tracked separately in #804. | |
| #995 fix: resolve ruff and mypy lint errors | craft-providers | merged | Merged after fixing ruff and mypy lint errors. Changes wrap implicit string concatenations, adjust test ignores for positional arguments, and correct type ignores and redundant casts. All CI checks passed and the change was approved. | |
| #1825 style(lint): fix ruff 0.6.0 linting errors | charmcraft | merged | Merged following two reviewer approvals and passing CI. The change resolves ruff 0.6.0 linting errors across 31 files using ruff's autofix, resulting in 70 additions and 71 deletions. | |
| #357 style: fix lints from ruff 0.12 | craft-cli | merged | Merged following approval from three reviewers and successful CI checks. Resolved lint errors introduced by Ruff 0.12 across seven files with minor code adjustments. | |
| #4981 style(lint): fix ruff 0.6 linting errors | snapcraft | merged | Merged after receiving two approvals and passing CI checks. Resolves ruff 0.6 linting errors with a minimal one-file change. | |
| #1465 style: fix linting issues for newer ruff | craft-parts | merged | Merged after two approvals and passing all CI checks. Resolves linting compatibility issues with newer ruff versions, updating five files. | |
| #580 style(ruff): fix linting issues from ruff update | craft-application | merged | Merged after approval by three reviewers. Resolves linting errors from a ruff update, modifying three files with a +7/-7 line change. Successfully integrated into the codebase. | |
| #423 style(lint): fix ruff 0.6.0 linting errors | craft-application | merged | Merged after two approvals and passing CI. Resolves ruff 0.6.0 linting errors across 21 files using ruff check --fix, applying automated style corrections to align with the updated linter version. |