MCPcopy Index your code
hub / github.com/ipython/ipython / environment

Function environment

tests/test_path.py:85–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83# Build decorator that uses the setup_environment/setup_environment
84@pytest.fixture
85def environment():
86 global oldstuff, platformstuff
87 oldstuff = (
88 env.copy(),
89 os.name,
90 sys.platform,
91 path.get_home_dir,
92 IPython.__file__,
93 os.getcwd(),
94 )
95
96 yield
97
98 (
99 oldenv,
100 os.name,
101 sys.platform,
102 path.get_home_dir,
103 IPython.__file__,
104 old_wd,
105 ) = oldstuff
106 os.chdir(old_wd)
107 reload(path)
108
109 for key in list(env):
110 if key not in oldenv:
111 del env[key]
112 env.update(oldenv)
113 assert not hasattr(sys, "frozen")
114
115
116with_environment = pytest.mark.usefixtures("environment")

Callers

nothing calls this directly

Calls 3

reloadFunction · 0.85
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…