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

Method next_set_method

Lib/test/test_bdb.py:367–415  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

365 raise BdbNotExpectedError(msg)
366
367 def next_set_method(self):
368 set_type = self.set_tuple[0]
369 args = self.set_tuple[1] if len(self.set_tuple) == 2 else None
370 set_method = getattr(self, 'set_' + set_type)
371
372 # The following set methods give back control to the tracer.
373 if set_type in ('step', 'stepinstr', 'continue', 'quit'):
374 set_method()
375 return
376 elif set_type in ('next', 'return'):
377 set_method(self.frame)
378 return
379 elif set_type == 'until':
380 lineno = None
381 if args:
382 lineno = self.lno_rel2abs(self.frame.f_code.co_filename,
383 args[0])
384 set_method(self.frame, lineno)
385 return
386
387 # The following set methods do not give back control to the tracer and
388 # next_set_method() is called recursively.
389 if (args and set_type in ('break', 'clear', 'ignore', 'enable',
390 'disable')) or set_type in ('up', 'down'):
391 if set_type in ('break', 'clear'):
392 fname, lineno, *remain = args
393 lineno = self.lno_rel2abs(fname, lineno)
394 args = [fname, lineno]
395 args.extend(remain)
396 set_method(*args)
397 elif set_type in ('ignore', 'enable', 'disable'):
398 set_method(*args)
399 elif set_type in ('up', 'down'):
400 set_method()
401
402 # Process the next expect_set item.
403 # It is not expected that a test may reach the recursion limit.
404 self.event= None
405 self.pop_next()
406 if self.dry_run:
407 self.print_state()
408 else:
409 if self.expect:
410 self.check_lno_name()
411 self.check_expect_max_size(3)
412 self.next_set_method()
413 else:
414 raise BdbSyntaxError('"%s" is an invalid set_tuple' %
415 self.set_tuple)
416
417class TracerRun():
418 """Provide a context for running a Tracer instance with a test case."""

Callers 5

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

Calls 7

lno_rel2absMethod · 0.95
pop_nextMethod · 0.95
print_stateMethod · 0.95
check_lno_nameMethod · 0.95
check_expect_max_sizeMethod · 0.95
BdbSyntaxErrorClass · 0.85
extendMethod · 0.45

Tested by

no test coverage detected