MCPcopy
hub / github.com/django/django / extend_sys_path

Function extend_sys_path

django/test/utils.py:791–798  ·  view source on GitHub ↗

Context manager to temporarily add paths to sys.path.

(*paths)

Source from the content-addressed store, hash-verified

789
790@contextmanager
791def extend_sys_path(*paths):
792 """Context manager to temporarily add paths to sys.path."""
793 _orig_sys_path = sys.path[:]
794 sys.path.extend(paths)
795 try:
796 yield
797 finally:
798 sys.path = _orig_sys_path
799
800
801@contextmanager

Callers 15

test_table_existsMethod · 0.90
test_egg1Method · 0.90
test_egg2Method · 0.90
test_egg3Method · 0.90
test_egg4Method · 0.90
test_egg5Method · 0.90
test_single_pathMethod · 0.90
test_multiple_pathsMethod · 0.90
test_shallow_loaderMethod · 0.90
test_deep_loaderMethod · 0.90

Calls 1

extendMethod · 0.80

Tested by 15

test_table_existsMethod · 0.72
test_egg1Method · 0.72
test_egg2Method · 0.72
test_egg3Method · 0.72
test_egg4Method · 0.72
test_egg5Method · 0.72
test_single_pathMethod · 0.72
test_multiple_pathsMethod · 0.72
test_shallow_loaderMethod · 0.72
test_deep_loaderMethod · 0.72