facebook / facebook/TestSlide

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

Aberta
#2 0 comentários 0 reações 0 responsáveis Ver no GitHub
bug help wanted Python Unittest
Linguagem predominante
Python
Estrelas
149
Forks
62
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.