【发布时间】:2018-03-24 15:10:01
【问题描述】:
我已经阅读了几个有类似问题的主题,但我不明白在我的情况下会引发错误。
我有一个类方法:
def submit_new_account_form(self, **credentials):
...
当我像这样在我的对象实例上调用它时:
create_new_account = loginpage.submit_new_account_form(
{'first_name': 'Test', 'last_name': 'Test', 'phone_or_email':
temp_email, 'newpass': '1q2w3e4r5t',
'sex': 'male'})
我收到此错误:
line 22, in test_new_account_succes
'sex': 'male'})
TypeError: submit_new_account_form() takes 1 positional argument but 2 were
given
【问题讨论】:
-
你知道
**kwargs是什么意思吗? -
请阅读我在 Reti43 评论下的评论
标签: python selenium dictionary keyword-argument