facebook / facebook/TestSlide

Focus & Skip broken for unittest.TestCase decorated by @patch

未关闭
#2 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug help wanted Python Unittest
主要语言
Python
星标
149
派生
62
PR 合并指标
30 天内没有已合并 PR

描述

For unittest.TestCase classes that are decorated with https://docs.python.org/3/library/unittest.mock.html#patch, when we do ftest or xtest, the decorator does to patch these methods, and we get a TypeError when running the test.

This happens because @patch is evaluated on the class loading, and it patches all methods there that begin with "test". Since ftest and xtest don't match the search, they're not decorated, and become broken.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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