MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / setup_state

Function setup_state

pythonwhat/test_exercise.py:114–130  ·  view source on GitHub ↗
(stu_code="", sol_code="", pec="", **kwargs)

Source from the content-addressed store, hash-verified

112
113
114def setup_state(stu_code="", sol_code="", pec="", **kwargs):
115 sol_process, stu_process, raw_stu_output, error = run_exercise(
116 pec, sol_code, stu_code, **kwargs
117 )
118
119 state = State(
120 student_code=stu_code,
121 solution_code=sol_code,
122 pre_exercise_code=pec,
123 student_process=stu_process,
124 solution_process=sol_process,
125 raw_student_output=raw_stu_output,
126 reporter=Reporter(errors=[error] if error else []),
127 )
128
129 State.root_state = state
130 return Ex(state)

Callers 15

test_basicFunction · 0.90
test_same_asFunction · 0.90
test_chainingFunction · 0.90
test_manual_converter_2Function · 0.90
test_equality_challengesFunction · 0.90
test_builtinsFunction · 0.90
test_attrsFunction · 0.90
test_numpy_builtinsFunction · 0.90
test_math_builtinsFunction · 0.90
test_list_methodsFunction · 0.90
test_varsFunction · 0.90

Calls 3

run_exerciseFunction · 0.90
StateClass · 0.90
ExFunction · 0.90

Tested by

no test coverage detected