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

Deprecate LOCUST_PLAYWRIGHT env var #2378

Merged
merged 2 commits into from
Aug 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions locust/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import os

if os.getenv("LOCUST_PLAYWRIGHT", False):
# This is a hack to make Playwright testing possible. If trio is not imported before gevent's monkey patching,
# it raises "NotImplementedError: unsupported platform"
# Playwright is used by PlaywrightUser, see https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/playwright_ex.py
import trio
if os.getenv("LOCUST_PLAYWRIGHT", None):
print("LOCUST_PLAYWRIGHT setting is no longer needed (because locust-plugins no longer installs trio)")
print("Uninstall trio package and remove the setting.")
try:
# preserve backwards compatibility for now
import trio
except ModuleNotFoundError:
# dont show a massive callstack if trio is not installed
os._exit(1)

from gevent import monkey

Expand Down
Loading