Design Automation Framework --PO Mode Self - --tdd parametric data driver configuration - inside the nested list listing

Import   the unittest
 from DDT Import   DDT, Data, the unpack 
TEST_DATA = TEST_DATA = [[l, 3], [4,5], [6, 7 are ]] 

@ddt 
class TestMath (of unittest.TestCase):
     DEF the setUp (Self):
         Pass 

    @data ( * TEST_DATA) 
    @unpack     # after "de-coat", split for each piece of data you've got, comma according to 
    DEF test_print_data (Self, a, b):   # in the need to press the split out of each piece of data number for parameter passing 
        Print (STR (A) + '        ' + STR (B)) 


IF  the __name__ == " __main__ " : 
    unittest.main ()

 

 

 

Results of the:

 

Guess you like

Origin www.cnblogs.com/xiaobaibailongma/p/12631530.html