How to use test_report_host2 method in locust

Best Python code snippet using locust

test_web.py

Source:test_web.py Github

copy

Full Screen

...264 self.stats.log_request("GET", "/test", 120, 5612)265 r = requests.get("http://127.0.0.1:%i/stats/report" % self.web_port)266 self.assertEqual(200, r.status_code)267 self.assertIn("http://test.com", r.text)268 def test_report_host2(self):269 class MyUser(User):270 host = "http://test2.com"271 @task272 def my_task(self):273 pass274 self.environment.host = None275 self.environment.user_classes = [MyUser]276 self.stats.log_request("GET", "/test", 120, 5612)277 r = requests.get("http://127.0.0.1:%i/stats/report" % self.web_port)278 self.assertEqual(200, r.status_code)279 self.assertIn("http://test2.com", r.text)280 def test_report_exceptions(self):281 try:282 raise Exception("Test exception")...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run locust automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful