Python TypeError:test#u Login()缺少2个必需的位置参数:';用户名';和';密码';

Python TypeError:test#u Login()缺少2个必需的位置参数:';用户名';和';密码';,python,python-3.x,Python,Python 3.x,我是python新手,正在使用python 3.4.3。执行以下代码时收到错误: test_Login()缺少2个必需的位置参数:“用户名”和“密码” 请你帮忙好吗 以下是我的脚本: @pytest.mark.usefixtures("oneTimeSetup","setUp") @ddt class ATS_Login(unittest.TestCase): log = CL.customLogger(logging.DEBUG) @pytest.fixture(autou

我是python新手,正在使用python 3.4.3。执行以下代码时收到错误: test_Login()缺少2个必需的位置参数:“用户名”和“密码”

请你帮忙好吗

以下是我的脚本:

 @pytest.mark.usefixtures("oneTimeSetup","setUp")
 @ddt
 class ATS_Login(unittest.TestCase):
   log = CL.customLogger(logging.DEBUG)

   @pytest.fixture(autouse=True)
   def classsetup(self, oneTimeSetup, setUp):
      self.AL=ATS_Login_page(self.driver)
      self.LO = ATS_Logout_page(self.driver)
      self.LD=ATS_Leaves(self.driver)
      self.SV=ATS_SalarySlip(self.driver)

  @pytest.mark.run(order=1)
  @data(*getcredentials("C:\\Users\\HP\\PycharmProjects\\ATS\\utilities\\testdata.csv"))
  @unpack
  def test_Login(self,username,password):
     self.AL.login(username,password)
下面是testdata.csv的内容

 username,password

 rupesh.doshi@gmail.com,rupesh

你的get凭证到底有什么作用。。??看起来它没有返回任何值。实际上程序运行如下。它将从文件testdata.csv获取凭据,并通过test_登录(self、username、password)方法。然后,它将使用相同的用户名和密码调用另一个类中定义的self.AL.Login方法,并登录到应用程序中。程序不会返回任何值,它只会从testdata.csv文件中传递参数username和password。要使代码正常工作,getcredentials方法必须返回一个包含(username,password)的元组。感谢Akash的反馈。请告诉我如何返回元组好吗?