How to use test_kill_locusts method in locust

Best Python code snippet using locust

test_runners.py

Source:test_runners.py Github

copy

Full Screen

...95 runner = LocustRunner([L1, L2, L3], mocked_options())96 self.assertEqual(1, len(runner.weight_locusts(1)))97 self.assert_locust_class_distribution({L1:1}, runner.weight_locusts(1))98 99 def test_kill_locusts(self):100 triggered = [False]101 class BaseLocust(Locust):102 class task_set(TaskSet):103 @task104 def trigger(self):105 triggered[0] = True106 runner = LocustRunner([BaseLocust], mocked_options())107 runner.spawn_locusts(2, wait=False)108 self.assertEqual(2, len(runner.locusts))109 g1 = list(runner.locusts)[0]110 g2 = list(runner.locusts)[1]111 runner.kill_locusts(2)112 self.assertEqual(0, len(runner.locusts))113 self.assertTrue(g1.dead)...

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