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

Method enterContext

Lib/unittest/case.py:480–486  ·  view source on GitHub ↗

Enters the supplied context manager. If successful, also adds its __exit__ method as a cleanup function and returns the result of the __enter__ method.

(self, cm)

Source from the content-addressed store, hash-verified

478 self._cleanups.append((function, args, kwargs))
479
480 def enterContext(self, cm):
481 """Enters the supplied context manager.
482
483 If successful, also adds its __exit__ method as a cleanup
484 function and returns the result of the __enter__ method.
485 """
486 return _enter_context(cm, self.addCleanup)
487
488 @classmethod
489 def addClassCleanup(cls, function, /, *args, **kwargs):

Callers 15

setUpMethod · 0.95
setUpMethod · 0.80
setUpMethod · 0.80
setUpMethod · 0.80
test_poll2Method · 0.80
setUpMethod · 0.80
test_recv_zeroMethod · 0.80
setUpMethod · 0.80

Calls 1

_enter_contextFunction · 0.85

Tested by 15

setUpMethod · 0.76
setUpMethod · 0.64
setUpMethod · 0.64
setUpMethod · 0.64
test_poll2Method · 0.64
setUpMethod · 0.64
test_recv_zeroMethod · 0.64
setUpMethod · 0.64