Skip to content

Add missing event hook parameter documentation#3344

Merged
cyberw merged 1 commit intolocustio:masterfrom
veeceey:fix/issue-3338
Feb 9, 2026
Merged

Add missing event hook parameter documentation#3344
cyberw merged 1 commit intolocustio:masterfrom
veeceey:fix/issue-3338

Conversation

@veeceey
Copy link
Copy Markdown
Contributor

@veeceey veeceey commented Feb 8, 2026

Summary

  • Adds missing environment parameter documentation to test_start, test_stopping, test_stop, and cpu_warning event hooks
  • Adds missing cpu_usage parameter documentation to the cpu_warning event hook
  • Adds the missing "Event arguments:" header to worker_connect for consistency with other documented hooks

Fixes #3338

Details

Several event hooks in locust/event.py were missing their keyword argument documentation, which caused confusion for users (e.g., the test_stop handler expecting environment but the docs not mentioning it). This PR documents the parameters by cross-referencing the actual fire() calls in runners.py, web.py, and debug.py.

Events updated:

Event Parameters Added
test_start environment
test_stopping environment
test_stop environment
cpu_warning environment, cpu_usage
worker_connect (added "Event arguments:" header for consistency)

Test plan

  • Verified Python syntax with ast.parse()
  • Confirmed rendered docs look correct in Sphinx (docstring-only change, follows existing patterns)

🤖 Generated with Claude Code

Document the keyword arguments for test_start, test_stopping,
test_stop, and cpu_warning event hooks. Also add the missing
"Event arguments:" header to worker_connect.

Fixes locustio#3338

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cyberw cyberw merged commit fdaf763 into locustio:master Feb 9, 2026
18 checks passed
@cyberw
Copy link
Copy Markdown
Collaborator

cyberw commented Feb 9, 2026

Nice!

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.

Documentation Improvement - Event hooks

2 participants