您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

暂时禁用单个Python单元测试

暂时禁用单个Python单元测试

单个的测试方法或类都可以使用unittest.skip装饰器禁用。

@unittest.skip("reason for skipping")
def test_foo():
    print('This is foo test case.')


@unittest.skip  # no reason needed
def test_bar():
    print('This is bar test case.')

有关其他选项,请参阅文档“跳过测试和预期的失败”

python 2022/1/1 18:40:41 有315人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶