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 摘要。