How to use test_aggregation_with_decimal_rounding method in locust

Best Python code snippet using locust

test_stats.py

Source:test_stats.py Github

copy

Full Screen

...145 self.assertEqual(s1.avg_response_time, 535.75)146 self.assertEqual(s1.min_response_time, 122)147 self.assertEqual(s1.max_response_time, 992)148 149 def test_aggregation_with_decimal_rounding(self):150 s1 = StatsEntry(self.stats, "round me!", "GET")151 s1.log(1.1, 0)152 s1.log(1.99, 0)153 s1.log(3.1, 0)154 self.assertEqual(s1.num_requests, 3)155 self.assertEqual(s1.median_response_time, 2)156 self.assertEqual(s1.avg_response_time, (1.1+1.99+3.1)/3)157 self.assertEqual(s1.min_response_time, 1.1)158 self.assertEqual(s1.max_response_time, 3.1)159 def test_aggregation_min_response_time(self):160 s1 = StatsEntry(self.stats, "min", "GET")161 s1.log(10, 0)162 self.assertEqual(10, s1.min_response_time)163 s2 = StatsEntry(self.stats, "min", "GET")...

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