我的测试用例看起来像这样。以下是代码:
@patch('something.mysqlclient')
@patch('something.esclient')
def testcase1(mysql,esclient):
esclient.return_value = 1
mysql.return_value = 3
assert something.modeul1.esclient == 1
assert something.modeul1.mysql == 3
答案 0 :(得分:0)
装饰器从下到上工作。
@patch('something.mysqlclient')
@patch('something.esclient')
def testcase1(esclient, mysql):
pass