fw_test.py
def _testmethod_():
x = []
y = 0
while y !=5:
x.append(y)
y +=1
return x
t = _testmethod_()
main_test.py
import subprocess
p = subprocess.call(['python', 'main_test.py'])
Due to the guidelines I cannot import fw_test.py
into main_test.py
. I want to be able to store the value returned by _testmethod_()
from fw_test.py
in a variable inmain_test.py
. I learned that with subprocess I can run the fw_test.py, but that is not enough for me.
Is there a way to go about this?
Edit: The reason why fw_test.py
cannot be imported to main_test.py
is that there are many test scripts like fw_test.py
which keeps on changing according to test. The main_test.py
is supposed to be a generic framework which has basic functions to evaluate the test passed or failed by reading the return value from fw_test.py
(the return value is True/False
). If I import the script in the top of the file it will not be generic anymore, I think. I'm open to other suggestions.
Why the downvotes?