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

Method __exit__

Lib/test/test_bdb.py:433–462  ·  view source on GitHub ↗
(self, type_=None, value=None, traceback=None)

Source from the content-addressed store, hash-verified

431 return self.tracer
432
433 def __exit__(self, type_=None, value=None, traceback=None):
434 reset_Breakpoint()
435 sys.settrace(self._original_tracer)
436
437 not_empty = ''
438 if self.tracer.set_list:
439 not_empty += 'All paired tuples have not been processed, '
440 not_empty += ('the last one was number %d\n' %
441 self.tracer.expect_set_no)
442 not_empty += repr(self.tracer.set_list)
443
444 # Make a BdbNotExpectedError a unittest failure.
445 if type_ is not None and issubclass(BdbNotExpectedError, type_):
446 if isinstance(value, BaseException) and value.args:
447 err_msg = value.args[0]
448 if not_empty:
449 err_msg += '\n' + not_empty
450 if self.dry_run:
451 print(err_msg)
452 return True
453 else:
454 self.test_case.fail(err_msg)
455 else:
456 assert False, 'BdbNotExpectedError with empty args'
457
458 if not_empty:
459 if self.dry_run:
460 print(not_empty)
461 else:
462 self.test_case.fail(not_empty)
463
464def run_test(modules, set_list, skip=None):
465 """Run a test and print the dry-run results.

Callers

nothing calls this directly

Calls 2

reset_BreakpointFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected