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

Function replaced_module

Lib/test/test_ordered_dict.py:25–31  ·  view source on GitHub ↗
(name, replacement)

Source from the content-addressed store, hash-verified

23
24@contextlib.contextmanager
25def replaced_module(name, replacement):
26 original_module = sys.modules[name]
27 sys.modules[name] = replacement
28 try:
29 yield
30 finally:
31 sys.modules[name] = original_module
32
33
34class OrderedDictTests:

Callers 2

test_copyingMethod · 0.70
test_pickle_recursiveMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected