尝试使用覆盖模块获取用python编写的代码的代码覆盖率 . 我正在使用moto来模拟boto3调用 .
但是为代码覆盖创建的html中没有涵盖模拟调用 .
使用follwing commnads生成报告
coverage run handler.py
coverage html handler.py
为了使问题简短,我只粘贴几行代码,以便我可以覆盖图像附加,call()方法应显示s3_client = boto3.client('s3')的覆盖范围 . 测试代码如下:
@mock_s3
def test_handler_moves_incoming_object_to_processed():
client = boto3.client('s3')
test_handler_moves_incoming_object_to_processed()