@@ -292,9 +292,7 @@ def shout( word = 'help', times = 3 ):
292292 """
293293
294294 # what the function will be referred to as
295- child = check_node (
296- state , "function_defs" , name , "definition of `{{index}}()`"
297- )
295+ child = check_node (state , "function_defs" , name , "definition of `{{index}}()`" )
298296
299297 test_args (
300298 child , arg_names , arg_defaults , nb_args_msg , arg_names_msg , arg_defaults_msg
@@ -339,7 +337,7 @@ def shout( word = 'help', times = 3 ):
339337
340338
341339def test_args (
342- state , arg_names , arg_defaults , nb_args_msg , arg_names_msg , arg_defaults_msg
340+ state , arg_names , arg_defaults , nb_args_msg , arg_names_msg , arg_defaults_msg
343341):
344342
345343 MSG_NUM_ARGS = "You should define {{parent[typestr]}} with {{sol_len}} arguments, instead got {{stu_len}}."
@@ -446,7 +444,11 @@ def test_object_after_expression(
446444 pre_code = None ,
447445 ** kwargs
448446):
449- state .highlight = state .ast_dispatcher .find ("object_assignments" , state .student_ast ).get (name , {}).get ("highlight" )
447+ state .highlight = (
448+ state .ast_dispatcher .find ("object_assignments" , state .student_ast )
449+ .get (name , {})
450+ .get ("highlight" )
451+ )
450452 has_equal_value (
451453 state ,
452454 incorrect_msg = incorrect_msg ,
@@ -496,9 +498,7 @@ def test_with(
496498 if context_vals :
497499 # test context var names ----
498500 has_context (
499- child ,
500- incorrect_msg = context_vals_msg or MSG_CTXT_NAMES ,
501- exact_names = True ,
501+ child , incorrect_msg = context_vals_msg or MSG_CTXT_NAMES , exact_names = True
502502 )
503503
504504 # test num context vars ----
@@ -511,7 +511,8 @@ def test_with(
511511 for i , context_test in enumerate (context_tests or []):
512512 # partial the substate check, because the function uses two prepended messages
513513 def check_context (state ):
514- return check_part_index (state ,
514+ return check_part_index (
515+ state ,
515516 "context" ,
516517 i ,
517518 "%s context" % utils .get_ord (i + 1 ),
@@ -543,8 +544,8 @@ def test_list_comp(
543544):
544545 """Test list comprehension."""
545546 kwargs = locals ().copy ()
546- kwargs [' typestr' ] = "{{ordinal}} list comprehension"
547- kwargs [' comptype' ] = "list_comps"
547+ kwargs [" typestr" ] = "{{ordinal}} list comprehension"
548+ kwargs [" comptype" ] = "list_comps"
548549 test_comp (** kwargs )
549550
550551
@@ -574,9 +575,7 @@ def test_comp(
574575 insufficient_ifs_msg = MSG_INSUFFICIENT_IFS
575576
576577 # get comprehension
577- child = check_node (
578- state , comptype , index - 1 , typestr , missing_msg = not_called_msg
579- )
578+ child = check_node (state , comptype , index - 1 , typestr , missing_msg = not_called_msg )
580579
581580 # test comprehension iter and its variable names (or number of variables)
582581 if comp_iter :
@@ -601,7 +600,4 @@ def test_comp(
601600 # test that ifs are same length
602601 has_equal_part_len (child , "ifs" , insufficient_ifs_msg )
603602 # test individual ifs
604- multi (
605- check_part_index (child , "ifs" , i , utils .get_ord (i + 1 ) + " if" ),
606- if_test ,
607- )
603+ multi (check_part_index (child , "ifs" , i , utils .get_ord (i + 1 ) + " if" ), if_test )
0 commit comments