Skip to content

fix: allow states and events named prepare - #735

Open
fbirds5230 wants to merge 1 commit into
fgmacedo:mainfrom
fbirds5230:fix/734-prepare-state-name
Open

fbirds5230 wants to merge 1 commit into
fgmacedo:mainfrom
fbirds5230:fix/734-prepare-state-name

Conversation

@fbirds5230

Copy link
Copy Markdown

Fixes #734.

A state named prepare overwrites the internal preparation callback group. Both engines then try to read .key from the state and raise AttributeError. An event with the same name fails for the same reason.

Move that group to _prepare, leaving prepare available for states and events. The prepare_event() callback still supplies additional keyword arguments to subsequent callbacks.

The regression tests cover both names on the sync and async engines, including initial activation, a completed transition, its return value, and the arguments supplied by prepare_event(). All four cases fail on the unchanged base and pass with this fix.

Validation:

  • Full suite: 2,977 passed, 26 skipped, 126 expected failures; 100% statement and branch coverage.
  • Original pre-commit hooks pass, including Ruff, Mypy, Pyright and pytest. Repository-wide Ruff and formatting checks also pass.
  • Sphinx builds successfully, with 48 warnings originating in unchanged documentation and docstrings.
  • Wheel and sdist build successfully and pass strict Twine checks.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

Can't use "prepare" as a state name

1 participant