You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromlocustimportHttpUser, task, tag, betweenimportlogging# Configure logginglogging.basicConfig(level=logging.DEBUG)
logger=logging.getLogger(__name__)
classTestUser(HttpUser):
# Set base URL to httpbinhost="https://httpbin.org"wait_time=between(1, 2)
@tag('get')@taskdeftest_get(self):
logger.debug("Executing GET request task - tags: api,get")
# The /get endpoint will return detailed request informationresponse=self.client.get("/get")
ifresponse.status_code==200:
logger.debug(f"GET request successful: {response.json()}")
@tag('post')@taskdeftest_post(self):
logger.debug("Executing POST request task - tags: api,post")
# Send some test datadata= {"name": "test", "value": "123"}
# The /post endpoint will return the sent data and request informationresponse=self.client.post("/post", json=data)
ifresponse.status_code==200:
logger.debug(f"POST request successful: {response.json()}")
@tag('web')@taskdeftest_html(self):
logger.debug("Executing HTML request task - tags: web")
# The /html endpoint will return a test HTML pageresponse=self.client.get("/html")
ifresponse.status_code==200:
logger.debug("HTML request successful")
Python version
3.10.15
Locust version
2.32.3
Operating system
MacBook Pro 2020
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
When using exclude-tags to exclude more than two tags, this setting will not take effect.
If exclude-tags is set to only one tag, it works correctly.
Command line
locust -f locust_test.py --exclude-tags get,post --headless
Locustfile contents
Python version
3.10.15
Locust version
2.32.3
Operating system
MacBook Pro 2020
The text was updated successfully, but these errors were encountered: