I tried researching on a way to return multiple values using single return variable. What i want to achieve is, i want the code below to act as if it is returning multiple value instead of returning a tuple
def my_data:
test_data = 1, 2, 3, 4 # etc (i have a LOT of data here)
return test_data
what i get is the following:
td = my_data()
print td
output : (1,2,3,4)
i want the function to act as it was doing the following code:
return 1,2,3,4
Is there a way to this?
EDIT!
i'm using this with python ddt
@ddt
class testsuite_my_function_validations(unittest.TestCase):
@data(my_data())
def test_various_number(self, value):
test_number = value
# test the number
It is suppose to have four test data (1, 2, 3 and 4) instead i'm getting a tuple value and not the those four numbers. But when i
return 1,2,3,4
The output will have four testcases:
- testcase test value 1
- testcase test value 2
- testcase test value 3
- testcase test value 4
return 1, 2, 3, 4is exactly the same withreturn test_data.