facebook / facebook/TestSlide

Add `--fail-if-warning`

未关闭
#195 4 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
enhancement Hacktoberfest help wanted
主要语言
Python
星标
149
派生
62
PR 合并指标
30 天内没有已合并 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。