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

Class _AssertNotWarnsContext

Lib/unittest/case.py:342–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340
341
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 1

_assertNotWarnsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…