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

[BUG] ImportError: The HttpLocust class has been renamed to HttpUser in version 1.0 #15

Open
marcinbaranowski5 opened this issue Feb 2, 2022 · 1 comment · May be fixed by #16
Open
Labels

Comments

@marcinbaranowski5
Copy link

Hello folks :),
first of all, thanks for this amazing tool!

Locust team did a lot of renaming https://docs.locust.io/en/latest/changelog.html#changelog-1-0
so when I try to run tests generated by the swagger-to-locustfile lib I get:

$ locust -f my/path/locustfile.py -H http://127.0.0.1:8000
Traceback (most recent call last):
  File "/some/path/clm/bin/locust", line 8, in <module>
    sys.exit(main())
  File "/some/path/clm/lib/python3.8/site-packages/locust/main.py", line 125, in main
    docstring, user_classes, shape_class = load_locustfile(locustfile)
  File "/some/path/clm/lib/python3.8/site-packages/locust/main.py", line 82, in load_locustfile
    imported = source.load_module()
  File "<frozen importlib._bootstrap_external>", line 522, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1027, in load_module
  File "<frozen importlib._bootstrap_external>", line 852, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/path/to/locustfile/locustfile.py", line 34, in <module>
    class MyLocust(HttpLocust):
  File "/some/path/lib/python3.8/site-packages/locust/util/deprecation.py", line 27, in __new__
    raise ImportError(deprecation_message)
ImportError: The HttpLocust class has been renamed to HttpUser in version 1.0. For more info see: https://docs.locust.io/en/latest/changelog.html#changelog-1-0
@lieldulev
Copy link
Owner

@marcinbaranowski5 thanks, i'm super busy, but i'll try to get to it in the next few weeks.

Feel free to contribute a fix ❤️

@lieldulev lieldulev added the bug label Mar 7, 2022
@1shooperman 1shooperman linked a pull request Jul 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants