facebook / facebook/TestSlide

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

Abierto
#2 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug help wanted Python Unittest
Lenguaje dominante
Python
Estrellas
149
Forks
62
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.