Skip to content

Stop declaring "fake" class level variables in Environment, User and StatsEntry#1948

Merged
cyberw merged 1 commit intomasterfrom
remove-fake-class-level-variables-from-Environment-and-Users
Dec 8, 2021
Merged

Stop declaring "fake" class level variables in Environment, User and StatsEntry#1948
cyberw merged 1 commit intomasterfrom
remove-fake-class-level-variables-from-Environment-and-Users

Conversation

@cyberw
Copy link
Collaborator

@cyberw cyberw commented Nov 29, 2021

Do it in constructor/instance level, where they belong instead.

The only benefit to having them on class level was so that they got documented properly, but it works as long as they are definied in init as well.

While this shouldnt be a breaking change for any "normal" usage of Locust, I think we need to do some testing to ensure that we dont need to bump major version.

Added some type hints as well.

…stats. Do it in constructor/instance level, where they belong instead.

The only benefit to having them on class level was so that they got documented properly, but it works as long as they are definied in __init__ as well.

While this shouldnt be a breaking change for any "normal" usage of Locust, I think we need to do some testing to ensure that we dont need to bump major version.

Added some type hints as well.
@cyberw cyberw changed the title Stop declaring "fake" class level variables in Environment, User and stats Stop declaring "fake" class level variables in Environment, User and StatsEntry Nov 29, 2021
@cyberw cyberw force-pushed the remove-fake-class-level-variables-from-Environment-and-Users branch from 9fe3e83 to 5d84379 Compare November 29, 2021 19:39
@cyberw cyberw merged commit c205e86 into master Dec 8, 2021
@cyberw cyberw deleted the remove-fake-class-level-variables-from-Environment-and-Users branch March 22, 2022 10:18
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