MCPcopy
hub / github.com/openai/openai-python / fresh_env

Function fresh_env

tests/test_module_client.py:111–119  ·  tests/test_module_client.py::fresh_env
()

Source from the content-addressed store, hash-verified

109
110@contextlib.contextmanager
111def fresh_env() -> Iterator[None]:
112 old = _os.environ.copy()
113
114 try:
115 _os.environ.clear()
116 yield
117 finally:
118 _os.environ.clear()
119 _os.environ.update(old)
120
121
122def test_only_api_key_results_in_openai_api() -> None:

Calls 3

copyMethod · 0.45
clearMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected