Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/datacamp/pythonwhat
/ in_temp_dir
Function
in_temp_dir
tests/helper.py:47–50 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
45
46
@contextmanager
47
def
in_temp_dir():
48
with
tempfile.TemporaryDirectory()
as
d:
49
with
ChDir(d):
50
yield
d
51
52
53
def
run(data, run_code=True):
Callers
7
test_urlretrieve_in_process
Function · 0.90
test_urlopen_in_process
Function · 0.90
test_run_relative_working_dir
Function · 0.90
test_run_solution_dir
Function · 0.90
test_run_with_absolute_dir
Function · 0.90
test_run_custom_solution_dir
Function · 0.90
run
Function · 0.85
Calls
1
ChDir
Class · 0.90
Tested by
6
test_urlretrieve_in_process
Function · 0.72
test_urlopen_in_process
Function · 0.72
test_run_relative_working_dir
Function · 0.72
test_run_solution_dir
Function · 0.72
test_run_with_absolute_dir
Function · 0.72
test_run_custom_solution_dir
Function · 0.72