Best Python code snippet using stestr_python
test_pstats.py
Source:test_pstats.py
...67class AddCallersTestCase(unittest.TestCase):8 """Tests for pstats.add_callers helper."""910 def test_combine_results(self):11 """pstats.add_callers should combine the call results of both target12 and source by adding the call time. See issue1269."""13 # new format: used by the cProfile module14 target = {"a": (1, 2, 3, 4)}15 source = {"a": (1, 2, 3, 4), "b": (5, 6, 7, 8)}16 new_callers = pstats.add_callers(target, source)17 self.assertEqual(new_callers, {'a': (2, 4, 6, 8), 'b': (5, 6, 7, 8)})18 # old format: used by the profile module19 target = {"a": 1}20 source = {"a": 1, "b": 5}21 new_callers = pstats.add_callers(target, source)22 self.assertEqual(new_callers, {'a': 2, 'b': 5})2324
...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!