Python TypeError-update()为关键字参数';获取了多个值;名称';
我有一个方法Python TypeError-update()为关键字参数';获取了多个值;名称';,python,Python,我有一个方法 @automation def update(self, name, **kwargs): """ method body """ 装饰师: def auto_call(f): def new_fn(self, *args, **kwargs): """ method body """ 自动化测试用例: update(name, **kwargs) 这里name有一个值,**kwargs从预定义的字典中获取值 虽然我使用的是self,并按照预期
@automation
def update(self, name, **kwargs):
"""
method body
"""
装饰师:
def auto_call(f):
def new_fn(self, *args, **kwargs):
"""
method body
"""
自动化测试用例:
update(name, **kwargs)
这里name有一个值,**kwargs从预定义的字典中获取值
虽然我使用的是self,并按照预期得到了下面的错误
TypeError: update() got multiple values for keyword argument 'name'
如果需要更改,请提供建议。测试用例中的
kwargs
是否包含键name
?测试中kwargs
的值是多少?它有关键字“name”。我认为这就是它的冲突。我将更新中的关键字从名称更改为id。似乎已解决此问题。