MCPcopy Index your code
hub / github.com/python/cpython / process_event

Method process_event

Lib/test/test_bdb.py:255–303  ·  view source on GitHub ↗
(self, event, frame, *args)

Source from the content-addressed store, hash-verified

253 self.set_tuple = self.set_list.pop(0)
254
255 def process_event(self, event, frame, *args):
256 # Call get_stack() to enable walking the stack with set_up() and
257 # set_down().
258 tb = None
259 if event == 'exception':
260 tb = self.exc_info[2]
261 self.get_stack(frame, tb)
262
263 # A breakpoint has been hit and it is not a temporary.
264 if self.currentbp is not None and not self.breakpoint_hits:
265 bp_list = [self.currentbp]
266 self.breakpoint_hits = (bp_list, [])
267
268 # Pop next event.
269 self.event= event
270 self.pop_next()
271 if self.dry_run:
272 self.print_state(self.header)
273 return
274
275 # Validate the expected results.
276 if self.expect:
277 self.check_equal(self.expect[0], event, 'Wrong event type')
278 self.check_lno_name()
279
280 if event in ('call', 'return'):
281 self.check_expect_max_size(3)
282 elif len(self.expect) > 3:
283 if event == 'line':
284 bps, temporaries = self.expect[3]
285 bpnums = sorted(bps.keys())
286 if not self.breakpoint_hits:
287 self.raise_not_expected(
288 'No breakpoints hit at expect_set item %d' %
289 self.expect_set_no)
290 self.check_equal(bpnums, self.breakpoint_hits[0],
291 'Breakpoint numbers do not match')
292 self.check_equal([bps[n] for n in bpnums],
293 [self.get_bpbynumber(n).hits for
294 n in self.breakpoint_hits[0]],
295 'Wrong breakpoint hit count')
296 self.check_equal(sorted(temporaries), self.breakpoint_hits[1],
297 'Wrong temporary breakpoints')
298
299 elif event == 'exception':
300 if not isinstance(self.exc_info[1], self.expect[3]):
301 self.raise_not_expected(
302 "Wrong exception at expect_set item %d, got '%s'" %
303 (self.expect_set_no, self.exc_info))
304
305 def check_equal(self, expected, result, msg):
306 if expected == result:

Callers 5

user_callMethod · 0.95
user_lineMethod · 0.95
user_returnMethod · 0.95
user_exceptionMethod · 0.95
user_opcodeMethod · 0.95

Calls 9

pop_nextMethod · 0.95
print_stateMethod · 0.95
check_equalMethod · 0.95
check_lno_nameMethod · 0.95
check_expect_max_sizeMethod · 0.95
raise_not_expectedMethod · 0.95
get_bpbynumberMethod · 0.80
get_stackMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected