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

Method __exit__

Lib/unittest/case.py:344–356  ·  view source on GitHub ↗
(self, exc_type, exc_value, tb)

Source from the content-addressed store, hash-verified

342class _AssertNotWarnsContext(_AssertWarnsContext):
343
344 def __exit__(self, exc_type, exc_value, tb):
345 self.warnings_manager.__exit__(exc_type, exc_value, tb)
346 if exc_type is not None:
347 # let unexpected exceptions pass through
348 return
349 try:
350 exc_name = self.expected.__name__
351 except AttributeError:
352 exc_name = str(self.expected)
353 for m in self.warnings:
354 w = m.message
355 if isinstance(w, self.expected):
356 self._raiseFailure(f"{exc_name} triggered")
357
358
359class _OrderedChainMap(collections.ChainMap):

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
_raiseFailureMethod · 0.80
__exit__Method · 0.45

Tested by

no test coverage detected