← Back to issue list

fix(tests): resolve ruff lint failures in test suite

View original Github issue

Metadata

Project
charmcraft
Number
#2819
Type
pull request
State
merged
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Merged charmcraft#2819, fixing four Ruff CI failures by making excess pytest arguments keyword-only and parenthesizing implicit string concatenations in tests.

Resolution: closed resolved

Reason: PR canonical/charmcraft#2819 was merged after approval. It resolves the PLR0917 and ISC004 failures, with affected tests and Ruff checks reported passing locally.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged charmcraft#2819, fixing four Ruff CI failures by making excess pytest arguments keyword-only and parenthesizing implicit string concatenations in tests.
stealth/space-bunny-alpha — closed resolved Merged in canonical/charmcraft#2819: fixed four Ruff test-suite errors by making extra pytest parameters keyword-only and parenthesizing implicit string concatenations.
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
#2229 style: fix linting errors charmcraft merged Merged charmcraft#2229 as commit 134e1cb6, fixing lint failures from the latest Ruff and Pyright across eight files.
78%
#33 lint: fix lint issues with newer ruff craft-archives merged PR #33 merged as commit c2a6687, fixing new lint failures introduced by a newer Ruff release across3 files (+5/-3). Maintainer deferred extra unit tests to CRAFT-1641.
74%
#1287 fix(tests): fixes bundle spread test charmcraft merged Merged PR #1287 (commit f60186ce, CRAFT-2052) fixed the failing bundle spread test by validating YAML with Python and dropping a non-working charm path check, resolving #1262.
73%
#803 style: fix linting issues with ruff 0.12 craft-application merged Merged via commit 5e15ff09, fixing Ruff 0.12 lint failures across 14 files. A separate integration-test failure was fixed by #804.
73%
#1329 test(style): remove pydocstyle tests on charmcraft code charmcraft merged Merged in commit e7c55c88: removed redundant pydocstyle tests covered by Ruff and relocated init-command test helpers.
73%
#1517 build: update ruff settings charmcraft merged Merged into charmcraft as commit 33854f04, updating the project's Ruff lint configuration (+6/-6).
73%
#1461 Replace flake8 and pydocstyle template tests with ruff charmcraft closed Ruff replaced flake8 and pydocstyle in Charmcraft template validation via merged PR #1941 (commit 9aba24c4).
72%
#1198 tests: add charm library multiple versions update test charmcraft merged Merged PR #1198 (commit 154bf5d6) added a 120-line regression test covering updates across multiple charm-library versions, linked to #1020/CRAFT-1916.
71%
#2383 style: update to ruff 0.12 charmcraft merged Merged PR #2383 updated Charmcraft to Ruff 0.12 and applied the associated lint and formatting changes across nine files.
71%
#2426 fix(test): fix the reactive charm spread test charmcraft merged Merged in canonical/charmcraft#2426 via commit 7c33dd1b, applying a one-line fix to the reactive-charm spread test for CHARMCRAFT-641.
70%