MCPcopy Index your code
hub / github.com/RustPython/RustPython / _AssertNotWarnsContext

Class _AssertNotWarnsContext

Lib/unittest/case.py:349–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

_assertNotWarnsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected