Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional typing improvements #2106

Merged
merged 3 commits into from
May 25, 2022

Conversation

mgor
Copy link
Contributor

@mgor mgor commented May 24, 2022

when doing some "integration" work with RequestStats, i noticed that there was a lot of stuff that was missing types and had inferred Any.

so this PR started out with the goal to add typing to locust.stats which took me down a rabbit hole of also adding types in locust.env, locust.web, locust.runners and locust.user.

i had to get creative in some places, which added a bit more code than just the types, mostly due to how many variables has an initial value of None.

also, maybe a bit unnecessary... but StatsEntry had serialize and unserialize, while StatsError for the same thing had to_dict and from_dict, so changed it so they have the same names.

@cyberw
Copy link
Collaborator

cyberw commented May 24, 2022

Awesome. Just let me test it against my own locustfiles first.

@cyberw cyberw merged commit 3502aa6 into locustio:master May 25, 2022
@cyberw
Copy link
Collaborator

cyberw commented May 25, 2022

thx

@mgor mgor deleted the feature/locust_typing_round_2 branch May 25, 2022 11:08
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.

2 participants