Skip to content

fix(typing): Fix *nodes type annotations in CeleryTestCluster#476

Merged
Nusnus merged 2 commits intocelery:mainfrom
Nusnus:hotfix
Mar 2, 2026
Merged

fix(typing): Fix *nodes type annotations in CeleryTestCluster#476
Nusnus merged 2 commits intocelery:mainfrom
Nusnus:hotfix

Conversation

@Nusnus
Copy link
Copy Markdown
Member

@Nusnus Nusnus commented Mar 2, 2026

The *args type annotation describes each individual argument, not a tuple. Changed *nodes: tuple[CeleryTestNode | CeleryTestContainer] to *nodes: CeleryTestNode | CeleryTestContainer across init, _set_nodes, and nodes setter. Also fixed tuple return types to use tuple[X, ...] for variable-length tuples.

Removed all related # type: ignore comments from fixtures and examples that were suppressing the resulting arg-type errors.

The *args type annotation describes each individual argument, not a
tuple. Changed *nodes: tuple[CeleryTestNode | CeleryTestContainer] to
*nodes: CeleryTestNode | CeleryTestContainer across __init__,
_set_nodes, and nodes setter. Also fixed tuple return types to use
tuple[X, ...] for variable-length tuples.

Removed all related # type: ignore comments from fixtures and examples
that were suppressing the resulting arg-type errors.
@Nusnus Nusnus self-assigned this Mar 2, 2026
The _set_nodes method has a concrete implementation in CeleryTestCluster
but was marked @AbstractMethod, causing mypy [abstract] errors when
instantiating subclasses (CeleryBrokerCluster, CeleryBackendCluster,
CeleryWorkerCluster) that don't override it.
@Nusnus Nusnus marked this pull request as ready for review March 2, 2026 17:11
@Nusnus Nusnus merged commit fe88c22 into celery:main Mar 2, 2026
48 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.75%. Comparing base (f00b0c2) to head (95c2410).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/pytest_celery/api/base.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   23.71%   23.75%   +0.03%     
==========================================
  Files          41       41              
  Lines        1303     1301       -2     
  Branches       78       78              
==========================================
  Hits          309      309              
+ Misses        967      965       -2     
  Partials       27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nusnus Nusnus deleted the hotfix branch March 2, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant