facebook / facebook/TestSlide

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

Aperta
#2 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug help wanted Python Unittest
Lingua principale
Python
Stelle
149
Fork
62
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.