facebook / facebook/TestSlide

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

オープン
#2 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。