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

Function replaced_module

Lib/test/test_functools.py:41–47  ·  view source on GitHub ↗
(name, replacement)

Source from the content-addressed store, hash-verified

39
40@contextlib.contextmanager
41def replaced_module(name, replacement):
42 original_module = sys.modules[name]
43 sys.modules[name] = replacement
44 try:
45 yield
46 finally:
47 sys.modules[name] = original_module
48
49def capture(*args, **kw):
50 """capture all positional and keyword arguments"""

Callers 2

test_pickleMethod · 0.70
test_recursive_pickleMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…