How do I pass a parameter from a WHEN TO a THEN in pytest bdd?
For example, if I have the following code:
@when('<n1> is a number divisible by 10')
def n1_is_a_number_divisible_by_10(n1):
assert (n1 % 10) == 0
newN1 = n1/10
return newN1
@then('the result will also be divisible by 3')
def the_result_will_also_be_divisible_by_3(newN1):
assert newN1 % 3 == 0
How do I pass newN1 from the when to the then?
(I have tried making newN1 a global variable...this works but making things global is often frowned upon in python).