diff --git a/routemaster/config/tests/test_next_states.py b/routemaster/config/tests/test_next_states.py index e5107d88..9463e452 100644 --- a/routemaster/config/tests/test_next_states.py +++ b/routemaster/config/tests/test_next_states.py @@ -36,7 +36,7 @@ def test_context_next_states(): ], ) - context = Context({'foo': True}, UTC_NOW, None) + context = Context({'foo': True}, UTC_NOW, None, []) assert next_states.all_destinations() == ['1', '2'] assert next_states.next_state_for_label(context) == '1' @@ -51,7 +51,7 @@ def test_context_next_states_raises_for_no_valid_state(): ], ) - context = Context({'foo': 'bar'}, UTC_NOW, None) + context = Context({'foo': 'bar'}, UTC_NOW, None, []) with pytest.raises(RuntimeError): next_states.next_state_for_label(context) diff --git a/routemaster/exit_conditions/tests/test_integration.py b/routemaster/exit_conditions/tests/test_integration.py index 34b106b6..6abd5b47 100644 --- a/routemaster/exit_conditions/tests/test_integration.py +++ b/routemaster/exit_conditions/tests/test_integration.py @@ -40,7 +40,8 @@ @pytest.mark.parametrize("program, expected, variables", PROGRAMS) def test_evaluate(program, expected, variables): program = ExitConditionProgram(program) - assert program.run(Context(VARIABLES, NOW)) == expected + context = Context(VARIABLES, NOW, None, program.accessed_variables()) + assert program.run(context) == expected @pytest.mark.parametrize("program, expected, variables", PROGRAMS) @@ -131,10 +132,12 @@ def test_accessed_variables(program, expected, variables): ] -@pytest.mark.parametrize("program, error", ERRORS) -def test_errors(program, error): +@pytest.mark.parametrize("source, error", ERRORS) +def test_errors(source, error): with pytest.raises(ValueError) as compile_error: - ExitConditionProgram(program).run(Context(VARIABLES, NOW)) + program = ExitConditionProgram(source) + context = Context(VARIABLES, NOW, None, program.accessed_variables()) + program.run(context) message = str(compile_error.value)