pytest the parameters of how to achieve?

We set automation project, is sure to encounter data-driven where it is needed, we used directly in unittest ddt way, but we can not use in pytest ddt to achieve, so we used a parametric way to achieve

So how do this specific parameterization it?

We still use the tagging pytest

E.g:

pytest.mark.parametrize @ ( " data " , test_login_datas.login_toast_error_data) 
  "" "
  data values of this parameter for receiving the end of the list of
  " ""
DEF test_name_error_login (Self, data, init_driver): "" "
    there is data and data must be the same name tags above
username error "" " init_driver [ . 1] .login (data [ " name " ], data [ " the passwd " ]) Assert (init_driver [. 1] .toast_error () == data [ " the Expect " ])

Guess you like

Origin www.cnblogs.com/LCboss/p/12028209.html