You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question: How can I parameterize my tests with global variable which changes values on runtime.
I have a global list variable which I populate the value in one of the test and I am using this variable to parameterize another test. One way I found out was to use pickle. Is there any other way I can handle this scenario?
Example -
myList= []
deftest_1():
globalmyListmyList= [1,2,3]
#This test should print 1,2,3@pytest.mark.parameterize("num", myList)deftest_2(num):
print(num)