11from pythonwhat .State import State
22from pythonwhat .local import run_exercise
3- from pythonwhat .sct_syntax import Ex
3+ from pythonwhat .sct_syntax import Ex , get_chains
44from pythonwhat .utils import check_str , check_process
55from protowhat .Reporter import Reporter
66from protowhat .failure import TestFail , InstructorError
@@ -37,7 +37,6 @@ def test_exercise(
3737 """
3838
3939 reporter = Reporter (errors = [error ] if error else [])
40- tree , sct_cntxt = prep_context ()
4140
4241 try :
4342 state = State (
@@ -52,6 +51,7 @@ def test_exercise(
5251 )
5352
5453 State .root_state = state
54+ tree , sct_cntxt = prep_context ()
5555
5656 # Actually execute SCTs
5757 exec (sct , sct_cntxt )
@@ -94,7 +94,6 @@ def prep_context():
9494 "from inspect import Parameter as param" ,
9595 "from pythonwhat.signatures import sig_from_params, sig_from_obj" ,
9696 "from pythonwhat.State import set_converter" ,
97- "from pythonwhat.sct_syntax import LazyChain as F, Ex" ,
9897 ]
9998 [exec (line , None , cntxt ) for line in imports ]
10099
@@ -106,6 +105,7 @@ def prep_context():
106105 tree = None
107106
108107 cntxt .update (v2_check_functions )
108+ cntxt .update (get_chains ())
109109 return tree , cntxt
110110
111111
0 commit comments