facebook/TestSlide

Add `--fail-if-warning`

Open

#195 创建于 2020年6月26日

在 GitHub 查看
 (4 评论) (2 反应) (0 负责人)Python (58 fork)auto 404
Hacktoberfestenhancementhelp wanted

仓库指标

Star
 (147 star)
PR 合并指标
 (PR 指标待抓取)

描述

Let's add an option --fail-if-warning, which'll look over issued warnings during test execution and fail them if warning issued. This can probably be done easily by patching Python's warning method and checking if it was called.

I see 3 cases to check for warnings:

1 - When importing test modules. 2 - When running individual tests. 3 - On shutdown.

For 1 & 2, this should be easy, not sure about 3.

An important feature of this, is to allow include / exclude paths to accept / ignore warnings. Eg: if a warning came from a third party library, there's sometimes little one can do, and we should ignore it. If warning came from the code being tested, it should surface.

贡献者指南