Skip to content

Commit

Permalink
Merge pull request #2378 from locustio/deprecate-LOCUST_PLAYWRIGHT-en…
Browse files Browse the repository at this point in the history
…v-var

Deprecate LOCUST_PLAYWRIGHT env var
  • Loading branch information
cyberw authored Aug 5, 2023
2 parents b833cf6 + 258287f commit f74ad24
Showing 1 changed file with 9 additions and 5 deletions.
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

0 comments on commit f74ad24

Please sign in to comment.