I have file say test1.py and it has variable var1 = '' and in one of the methods in test1.py I'm updating value of var1 as
global var1
var1 = 'new_value'
And I can see value updated by printing it from another method in test1.py.
Now I have another file test2.py In which I'm calling var1 as var_new = test1.var1
But when I print it I still get ''.
I think at the start of suite it's initializing all modules. But when I am calling method in test2.py it is getting value when it initialized? How can I get updated value?
So var_new prints ''
If I use get_var() method then I get updated value. So I guess I have create the method always?
test1.var1="new_value"