How to use test_custom_percentile_list method in locust

Best Python code snippet using locust

test_stats.py

Source:test_stats.py Github

copy

Full Screen

...207 s2 = StatsEntry(self.stats, "rounding up!", "GET")208 s2.log(127, 0) # (rounded 130) min209 actual_percentile = s2.percentile().split()210 self.assertEqual(actual_percentile, ["GET", "rounding", "up!"] + ["130"] * len(PERCENTILES_TO_REPORT) + ["1"])211 def test_custom_percentile_list(self):212 s = StatsEntry(self.stats, "custom_percentiles", "GET")213 custom_percentile_list = [0.50, 0.90, 0.95, 0.99]214 locust.stats.PERCENTILES_TO_REPORT = custom_percentile_list215 s.log(150, 0)216 actual_percentile = s.percentile().split()217 self.assertEqual(218 actual_percentile, ["GET", "custom_percentiles"] + ["150"] * len(custom_percentile_list) + ["1"]219 )220 def test_error_grouping(self):221 # reset stats222 self.stats = RequestStats()223 self.stats.log_error("GET", "/some-path", Exception("Exception!"))224 self.stats.log_error("GET", "/some-path", Exception("Exception!"))225 self.assertEqual(1, len(self.stats.errors))...

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